diff --git a/swaggerci/storage/.gitattributes b/swaggerci/storage/.gitattributes new file mode 100644 index 000000000000..2125666142eb --- /dev/null +++ b/swaggerci/storage/.gitattributes @@ -0,0 +1 @@ +* text=auto \ No newline at end of file diff --git a/swaggerci/storage/.gitignore b/swaggerci/storage/.gitignore new file mode 100644 index 000000000000..7998f37e1e47 --- /dev/null +++ b/swaggerci/storage/.gitignore @@ -0,0 +1,5 @@ +bin +obj +.vs +tools +test/*-TestResults.xml \ No newline at end of file diff --git a/swaggerci/storage/Az.Storage.csproj b/swaggerci/storage/Az.Storage.csproj new file mode 100644 index 000000000000..8a2a0ba5cbba --- /dev/null +++ b/swaggerci/storage/Az.Storage.csproj @@ -0,0 +1,44 @@ + + + + 0.1.0 + 7.1 + netstandard2.0 + Library + Az.Storage.private + Microsoft.Azure.PowerShell.Cmdlets.Storage + true + false + ./bin + $(OutputPath) + Az.Storage.nuspec + true + + + 1998, 1591 + true + + + + + false + TRACE;DEBUG;NETSTANDARD + + + + true + true + MSSharedLibKey.snk + TRACE;RELEASE;NETSTANDARD;SIGN + + + + + + + + + $(DefaultItemExcludes);resources/** + + + \ No newline at end of file diff --git a/swaggerci/storage/Az.Storage.format.ps1xml b/swaggerci/storage/Az.Storage.format.ps1xml new file mode 100644 index 000000000000..1fac7916624e --- /dev/null +++ b/swaggerci/storage/Az.Storage.format.ps1xml @@ -0,0 +1,5549 @@ + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.StorageIdentity + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountName + + + BlobInventoryPolicyName + + + BlobServicesName + + + ContainerName + + + DeletedAccountName + + + EncryptionScopeName + + + FileServicesName + + + Id + + + ImmutabilityPolicyName + + + Location + + + ManagementPolicyName + + + ObjectReplicationPolicyId + + + PrivateEndpointConnectionName + + + QueueName + + + QueueServiceName + + + ResourceGroupName + + + ShareName + + + SubscriptionId + + + TableName + + + TableServiceName + + + Username + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccessPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccessPolicy + + + + + + + + + + + + + + + + + + ExpiryTime + + + Permission + + + StartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyProperties + + + + + + + + + + + + + + + + + + AllowProtectedAppendWrite + + + ImmutabilityPeriodSinceCreationInDay + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountSasParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountSasParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + IPAddressOrRange + + + KeyToSign + + + Permission + + + Protocol + + + ResourceType + + + Service + + + SharedAccessExpiryTime + + + SharedAccessStartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccountType + + + AzureStorageSid + + + DomainGuid + + + DomainName + + + DomainSid + + + ForestName + + + NetBiosDomainName + + + SamAccountName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication + + + + + + + + + + + + + + + DefaultSharePermission + + + DirectoryServiceOption + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicy + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyDefinition + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyDefinition + + + + + + + + + + + + + + + + + + + + + Format + + + ObjectType + + + Schedule + + + SchemaField + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilter + + + + + + + + + + + + + + + + + + + + + + + + + + + BlobType + + + ExcludePrefix + + + IncludeBlobVersion + + + IncludeDeleted + + + IncludeSnapshot + + + PrefixMatch + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyProperties + + + + + + + + + + + + LastModifiedTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRule + + + + + + + + + + + + + + + + + + Destination + + + Enabled + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchema + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchema + + + + + + + + + + + + + + + + + + Destination + + + Enabled + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParameters + + + + + + + + + + + + TimeToRestore + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRange + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRange + + + + + + + + + + + + + + + EndRange + + + StartRange + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatus + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatus + + + + + + + + + + + + + + + + + + FailureReason + + + RestoreId + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesAutoGenerated + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesAutoGenerated + + + + + + + + + + + + + + + + + + AutomaticSnapshotPolicyEnabled + + + DefaultServiceVersion + + + IsVersioningEnabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ChangeFeed + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ChangeFeed + + + + + + + + + + + + + + + Enabled + + + RetentionInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CheckNameAvailabilityResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CheckNameAvailabilityResult + + + + + + + + + + + + + + + + + + Message + + + NameAvailable + + + Reason + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBody + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBody + + + + + + + + + + + + + + + + + + Code + + + Message + + + Target + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DefaultEncryptionScope + + + Deleted + + + DeletedTime + + + DenyEncryptionScopeOverride + + + EnableNfsV3AllSquash + + + EnableNfsV3RootSquash + + + HasImmutabilityPolicy + + + HasLegalHold + + + LastModifiedTime + + + LeaseDuration + + + LeaseState + + + LeaseStatus + + + PublicAccess + + + RemainingRetentionDay + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRule + + + + + + + + + + + + + + + + + + + + + + + + AllowedHeader + + + AllowedMethod + + + AllowedOrigin + + + ExposedHeader + + + MaxAgeInSecond + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain + + + + + + + + + + + + + + + Name + + + UseSubDomainName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation + + + + + + + + + + + + + + + DaysAfterCreationGreaterThan + + + DaysAfterLastTierChangeGreaterThan + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification + + + + + + + + + + + + + + + + + + + + + DaysAfterCreationGreaterThan + + + DaysAfterLastAccessTimeGreaterThan + + + DaysAfterLastTierChangeGreaterThan + + + DaysAfterModificationGreaterThan + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccount + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccount + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountListResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountProperties + + + + + + + + + + + + + + + + + + + + + + + + CreationTime + + + DeletionTime + + + Location + + + RestoreReference + + + StorageAccountResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedShare + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedShare + + + + + + + + + + + + + + + Name + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy + + + + + + + + + + + + + + + + + + AllowPermanentDelete + + + Day + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Dimension + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Dimension + + + + + + + + + + + + + + + DisplayName + + + Name + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption + + + + + + + + + + + + + + + KeySource + + + RequireInfrastructureEncryption + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionIdentity + + + + + + + + + + + + + + + EncryptionFederatedIdentityClientId + + + EncryptionUserAssignedIdentity + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultProperties + + + + + + + + + + + + + + + + + + CurrentVersionedKeyIdentifier + + + KeyUri + + + LastKeyRotationTimestamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeListResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeProperties + + + + + + + + + + + + + + + + + + + + + + + + CreationTime + + + LastModifiedTime + + + RequireInfrastructureEncryption + + + Source + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService + + + + + + + + + + + + + + + + + + Enabled + + + KeyType + + + LastEnabledTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints + + + + + + + + + + + + + + + + + + + + + + + + + + + Blob + + + Df + + + File + + + Queue + + + Table + + + Web + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponseBody + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponseBody + + + + + + + + + + + + + + + Code + + + Message + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItem + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItem + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItems + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItems + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AccessTierChangeTime + + + AccessTierStatus + + + Deleted + + + DeletedTime + + + EnabledProtocol + + + LastModifiedTime + + + LeaseDuration + + + LeaseState + + + LeaseStatus + + + RemainingRetentionDay + + + RootSquash + + + ShareQuota + + + ShareUsageByte + + + SnapshotTime + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStats + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStats + + + + + + + + + + + + + + + + + + CanFailover + + + LastSyncTime + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity + + + + + + + + + + + + + + + + + + PrincipalId + + + TenantId + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy + + + + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + ETag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperties + + + + + + + + + + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty + + + + + + + + + + + + + + + + + + + + + AllowProtectedAppendWrite + + + AllowProtectedAppendWritesAll + + + ImmutabilityPeriodSinceCreationInDay + + + State + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioning + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioning + + + + + + + + + + + + + + + + + + Enabled + + + MigrationState + + + TimeStamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRule + + + + + + + + + + + + + + + Action + + + IPAddressOrRange + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTime + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTime + + + + + + + + + + + + + + + Key1 + + + Key2 + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy + + + + + + + + + + + + KeyExpirationPeriodInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyVaultProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyVaultProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + CurrentVersionedKeyExpirationTimestamp + + + CurrentVersionedKeyIdentifier + + + KeyName + + + KeyVaultUri + + + KeyVersion + + + LastKeyRotationTimestamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LastAccessTimeTrackingPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LastAccessTimeTrackingPolicy + + + + + + + + + + + + + + + + + + + + + BlobType + + + Enable + + + Name + + + TrackingGranularityInDay + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseContainerRequest1 + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseContainerRequest1 + + + + + + + + + + + + + + + + + + + + + + + + Action + + + BreakPeriod + + + LeaseDuration + + + LeaseId + + + ProposedLeaseId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseContainerResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseContainerResponse + + + + + + + + + + + + + + + LeaseId + + + LeaseTimeSecond + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseShareRequest + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseShareRequest + + + + + + + + + + + + + + + + + + + + + + + + Action + + + BreakPeriod + + + LeaseDuration + + + LeaseId + + + ProposedLeaseId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseShareResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseShareResponse + + + + + + + + + + + + + + + + + + ETag + + + LeaseId + + + LeaseTimeSecond + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHold + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHold + + + + + + + + + + + + + + + + + + AllowProtectedAppendWritesAll + + + HasLegalHold + + + Tag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldProperties + + + + + + + + + + + + HasLegalHold + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListAccountSasResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListAccountSasResponse + + + + + + + + + + + + AccountSasToken + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItem + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItem + + + + + + + + + + + + + + + + + + + + + Etag + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItems + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItems + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueue + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueue + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueResource + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListServiceSasResponse + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListServiceSasResponse + + + + + + + + + + + + ServiceSasToken + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListTableResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListTableResource + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUser + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUser + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserKeys + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserKeys + + + + + + + + + + + + SharedKey + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserProperties + + + + + + + + + + + + + + + + + + + + + + + + HasSharedKey + + + HasSshKey + + + HasSshPassword + + + HomeDirectory + + + Sid + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserRegeneratePasswordResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserRegeneratePasswordResult + + + + + + + + + + + + SshPassword + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicy + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyBaseBlob + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyBaseBlob + + + + + + + + + + + + EnableAutoTierToHotFromCool + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilter + + + + + + + + + + + + + + + BlobType + + + PrefixMatch + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyProperties + + + + + + + + + + + + LastModifiedTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRule + + + + + + + + + + + + + + + + + + Enabled + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecification + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecification + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AggregationType + + + Category + + + DisplayDescription + + + DisplayName + + + FillGapWithZero + + + Name + + + ResourceIdDimensionNameOverride + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Multichannel + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Multichannel + + + + + + + + + + + + Enabled + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet + + + + + + + + + + + + + + + Bypass + + + DefaultAction + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicy + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyFilter + + + + + + + + + + + + + + + MinCreationTime + + + PrefixMatch + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyProperties + + + + + + + + + + + + + + + + + + + + + DestinationAccount + + + EnabledTime + + + PolicyId + + + SourceAccount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyRule + + + + + + + + + + + + + + + + + + DestinationContainer + + + RuleId + + + SourceContainer + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Operation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Operation + + + + + + + + + + + + + + + Name + + + Origin + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationDisplay + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationDisplay + + + + + + + + + + + + + + + + + + + + + Description + + + Operation + + + Provider + + + Resource + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PermissionScope + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PermissionScope + + + + + + + + + + + + + + + + + + Permission + + + ResourceName + + + Service + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpoint + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpoint + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnection + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnection + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionProperties + + + + + + + + + + + + ProvisioningState + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceProperties + + + + + + + + + + + + + + + + + + GroupId + + + RequiredMember + + + RequiredZoneName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionState + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionState + + + + + + + + + + + + + + + + + + ActionRequired + + + Description + + + Status + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistory + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistory + + + + + + + + + + + + + + + AllowProtectedAppendWritesAll + + + Timestamp + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueProperties + + + + + + + + + + + + ApproximateMessageCount + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadata + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadata + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRule + + + + + + + + + + + + + + + ResourceId + + + TenantId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestorePolicyProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestorePolicyProperties + + + + + + + + + + + + + + + + + + + + + Day + + + Enabled + + + LastEnabledTime + + + MinRestoreTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Restriction + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Restriction + + + + + + + + + + + + + + + + + + ReasonCode + + + Type + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference + + + + + + + + + + + + + + + + + + PublishInternetEndpoint + + + PublishMicrosoftEndpoint + + + RoutingChoice + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy + + + + + + + + + + + + + + + ExpirationAction + + + SasExpirationPeriod + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSasParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSasParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + CacheControl + + + CanonicalizedResource + + + ContentDisposition + + + ContentEncoding + + + ContentLanguage + + + ContentType + + + IPAddressOrRange + + + Identifier + + + KeyToSign + + + PartitionKeyEnd + + + PartitionKeyStart + + + Permission + + + Protocol + + + Resource + + + RowKeyEnd + + + RowKeyStart + + + SharedAccessExpiryTime + + + SharedAccessStartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifier + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifier + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku + + + + + + + + + + + + + + + Name + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuCapability + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuCapability + + + + + + + + + + + + + + + Name + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuInformation + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuInformation + + + + + + + + + + + + + + + + + + + + + + + + Kind + + + Location + + + Name + + + ResourceType + + + Tier + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSetting + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSetting + + + + + + + + + + + + + + + + + + + + + AuthenticationMethod + + + ChannelEncryption + + + KerberosTicketEncryption + + + Version + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKey + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKey + + + + + + + + + + + + + + + Description + + + Key + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccount + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccount + + + + + + + + + + + + + + + + + + + + + + + + Id + + + Location + + + Name + + + Type + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCheckNameAvailabilityParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCheckNameAvailabilityParameters + + + + + + + + + + + + + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParameters + + + + + + + + + + + + + + + Kind + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpoints + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpoints + + + + + + + + + + + + + + + + + + + + + Blob + + + Df + + + File + + + Web + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountKey + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountKey + + + + + + + + + + + + + + + + + + + + + CreationTime + + + KeyName + + + Permission + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountListResult + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountListResult + + + + + + + + + + + + NextLink + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpoints + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpoints + + + + + + + + + + + + + + + + + + + + + + + + + + + Blob + + + Df + + + File + + + Queue + + + Table + + + Web + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountProperties + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AllowBlobPublicAccess + + + AllowCrossTenantReplication + + + AllowSharedKeyAccess + + + AllowedCopyScope + + + CreationTime + + + DefaultToOAuthAuthentication + + + DnsEndpointType + + + EnableHttpsTrafficOnly + + + EnableNfsV3 + + + FailoverInProgress + + + IsHnsEnabled + + + IsLocalUserEnabled + + + IsSftpEnabled + + + LargeFileSharesState + + + LastGeoFailoverTime + + + MinimumTlsVersion + + + PrimaryLocation + + + ProvisioningState + + + PublicNetworkAccess + + + SecondaryLocation + + + StatusOfPrimary + + + StatusOfSecondary + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesCreateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesCreateParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AllowBlobPublicAccess + + + AllowCrossTenantReplication + + + AllowSharedKeyAccess + + + AllowedCopyScope + + + DefaultToOAuthAuthentication + + + DnsEndpointType + + + EnableHttpsTrafficOnly + + + EnableNfsV3 + + + IsHnsEnabled + + + IsLocalUserEnabled + + + IsSftpEnabled + + + LargeFileSharesState + + + MinimumTlsVersion + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesUpdateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesUpdateParameters + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AccessTier + + + AllowBlobPublicAccess + + + AllowCrossTenantReplication + + + AllowSharedKeyAccess + + + AllowedCopyScope + + + DefaultToOAuthAuthentication + + + DnsEndpointType + + + EnableHttpsTrafficOnly + + + IsLocalUserEnabled + + + IsSftpEnabled + + + LargeFileSharesState + + + MinimumTlsVersion + + + PublicNetworkAccess + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountRegenerateKeyParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountRegenerateKeyParameters + + + + + + + + + + + + KeyName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatus + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatus + + + + + + + + + + + + + + + + + + + + + EndTime + + + SkuConversionStatus + + + StartTime + + + TargetSkuName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParameters + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParameters + + + + + + + + + + + + Kind + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParametersTags + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParametersTags + + + + + + + + + + + + Item + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableAccessPolicy + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableAccessPolicy + + + + + + + + + + + + + + + + + + ExpiryTime + + + Permission + + + StartTime + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableProperties + + + + + + + + + + + + TableName + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServiceProperties + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServiceProperties + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableSignedIdentifier + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableSignedIdentifier + + + + + + + + + + + + Id + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilter + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilter + + + + + + + + + + + + + + + + + + Name + + + Op + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagProperty + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagProperty + + + + + + + + + + + + + + + + + + + + + + + + ObjectIdentifier + + + Tag + + + TenantId + + + Timestamp + + + Upn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryProperty + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryProperty + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + AllowProtectedAppendWrite + + + AllowProtectedAppendWritesAll + + + ImmutabilityPeriodSinceCreationInDay + + + ObjectIdentifier + + + TenantId + + + Timestamp + + + Update + + + Upn + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Usage + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Usage + + + + + + + + + + + + + + + + + + CurrentValue + + + Limit + + + Unit + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageName + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageName + + + + + + + + + + + + + + + LocalizedValue + + + Value + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UserAssignedIdentity + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UserAssignedIdentity + + + + + + + + + + + + + + + ClientId + + + PrincipalId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRule + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRule + + + + + + + + + + + + + + + + + + Action + + + State + + + VirtualNetworkResourceId + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData + + + + + + + + + + + + + + + + + + + + + + + + + + + CreatedAt + + + CreatedBy + + + CreatedByType + + + LastModifiedAt + + + LastModifiedBy + + + LastModifiedByType + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Etag + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ProxyResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ProxyResource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResource + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResource + + + + + + + + + + + + + + + + + + + + + Id + + + Name + + + Type + + + Location + + + + + + + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTags + + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTags + + + + + + + + + + + + Item + + + + + + + + \ No newline at end of file diff --git a/swaggerci/storage/Az.Storage.nuspec b/swaggerci/storage/Az.Storage.nuspec new file mode 100644 index 000000000000..f7e8b99e1f56 --- /dev/null +++ b/swaggerci/storage/Az.Storage.nuspec @@ -0,0 +1,32 @@ + + + + Az.Storage + 0.1.0 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell: $(service-name) cmdlets + + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM PSModule $(service-name) + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/storage/Az.Storage.psd1 b/swaggerci/storage/Az.Storage.psd1 new file mode 100644 index 000000000000..ad08e7b889e8 --- /dev/null +++ b/swaggerci/storage/Az.Storage.psd1 @@ -0,0 +1,24 @@ +@{ + GUID = '25f42a87-85e3-4f19-ae4d-59507c3cee32' + RootModule = './Az.Storage.psm1' + ModuleVersion = '0.1.0' + CompatiblePSEditions = 'Core', 'Desktop' + Author = 'Microsoft Corporation' + CompanyName = 'Microsoft Corporation' + Copyright = 'Microsoft Corporation. All rights reserved.' + Description = 'Microsoft Azure PowerShell: Storage cmdlets' + PowerShellVersion = '5.1' + DotNetFrameworkVersion = '4.7.2' + RequiredAssemblies = './bin/Az.Storage.private.dll' + FormatsToProcess = './Az.Storage.format.ps1xml' + FunctionsToExport = 'Clear-AzStorageBlobContainerLegalHold', 'Get-AzStorageAccount', 'Get-AzStorageAccountKey', 'Get-AzStorageAccountProperty', 'Get-AzStorageAccountSas', 'Get-AzStorageAccountServiceSas', 'Get-AzStorageBlobContainer', 'Get-AzStorageBlobContainerImmutabilityPolicy', 'Get-AzStorageBlobInventoryPolicy', 'Get-AzStorageBlobService', 'Get-AzStorageBlobServiceProperty', 'Get-AzStorageDeletedAccount', 'Get-AzStorageEncryptionScope', 'Get-AzStorageFileService', 'Get-AzStorageFileServiceProperty', 'Get-AzStorageFileShare', 'Get-AzStorageLocalUser', 'Get-AzStorageLocalUserKey', 'Get-AzStorageManagementPolicy', 'Get-AzStorageObjectReplicationPolicy', 'Get-AzStoragePrivateEndpointConnection', 'Get-AzStoragePrivateLinkResource', 'Get-AzStorageQueue', 'Get-AzStorageQueueService', 'Get-AzStorageQueueServiceProperty', 'Get-AzStorageSku', 'Get-AzStorageTable', 'Get-AzStorageTableService', 'Get-AzStorageTableServiceProperty', 'Get-AzStorageUsage', 'Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration', 'Invoke-AzStorageExtendBlobContainerImmutabilityPolicy', 'Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration', 'Invoke-AzStorageLeaseBlobContainer', 'Invoke-AzStorageLeaseFileShare', 'Invoke-AzStorageObjectBlobContainerLevelWorm', 'Lock-AzStorageBlobContainerImmutabilityPolicy', 'New-AzStorageAccount', 'New-AzStorageAccountKey', 'New-AzStorageBlobContainer', 'New-AzStorageBlobContainerImmutabilityPolicy', 'New-AzStorageBlobInventoryPolicy', 'New-AzStorageFileShare', 'New-AzStorageLocalUser', 'New-AzStorageLocalUserPassword', 'New-AzStorageManagementPolicy', 'New-AzStorageObjectReplicationPolicy', 'New-AzStorageQueue', 'New-AzStorageTable', 'Remove-AzStorageAccount', 'Remove-AzStorageBlobContainer', 'Remove-AzStorageBlobContainerImmutabilityPolicy', 'Remove-AzStorageBlobInventoryPolicy', 'Remove-AzStorageFileShare', 'Remove-AzStorageLocalUser', 'Remove-AzStorageManagementPolicy', 'Remove-AzStorageObjectReplicationPolicy', 'Remove-AzStoragePrivateEndpointConnection', 'Remove-AzStorageQueue', 'Remove-AzStorageTable', 'Restore-AzStorageAccountBlobRange', 'Restore-AzStorageFileShare', 'Revoke-AzStorageAccountUserDelegationKey', 'Test-AzStorageAccountNameAvailability', 'Update-AzStorageAccount', 'Update-AzStorageBlobContainer', 'Update-AzStorageEncryptionScope', 'Update-AzStorageFileShare', 'Update-AzStorageQueue', 'Update-AzStorageTable', '*' + AliasesToExport = '*' + PrivateData = @{ + PSData = @{ + Tags = 'Azure', 'ResourceManager', 'ARM', 'PSModule', 'Storage' + LicenseUri = 'https://aka.ms/azps-license' + ProjectUri = 'https://github.com/Azure/azure-powershell' + ReleaseNotes = '' + } + } +} diff --git a/swaggerci/storage/Az.Storage.psm1 b/swaggerci/storage/Az.Storage.psm1 new file mode 100644 index 000000000000..1f63c3fa6b3b --- /dev/null +++ b/swaggerci/storage/Az.Storage.psm1 @@ -0,0 +1,107 @@ +# region Generated + # ---------------------------------------------------------------------------------- + # Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. + # ---------------------------------------------------------------------------------- + # Load required Az.Accounts module + $accountsName = 'Az.Accounts' + $accountsModule = Get-Module -Name $accountsName + if(-not $accountsModule) { + $localAccountsPath = Join-Path $PSScriptRoot 'generated/modules' + if(Test-Path -Path $localAccountsPath) { + $localAccounts = Get-ChildItem -Path $localAccountsPath -Recurse -Include 'Az.Accounts.psd1' | Select-Object -Last 1 + if($localAccounts) { + $accountsModule = Import-Module -Name ($localAccounts.FullName) -Scope Global -PassThru + } + } + if(-not $accountsModule) { + $hasAdequateVersion = (Get-Module -Name $accountsName -ListAvailable | Where-Object { $_.Version -ge [System.Version]'2.7.5' } | Measure-Object).Count -gt 0 + if($hasAdequateVersion) { + $accountsModule = Import-Module -Name $accountsName -MinimumVersion 2.7.5 -Scope Global -PassThru + } + } + } + + if(-not $accountsModule) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. For installation instructions, please see: https://docs.microsoft.com/powershell/azure/install-az-ps" -ErrorAction Stop + } elseif (($accountsModule.Version -lt [System.Version]'2.7.5') -and (-not $localAccounts)) { + Write-Error "`nThis module requires $accountsName version 2.7.5 or greater. An earlier version of Az.Accounts is imported in the current PowerShell session. If you are running test, please try to add the switch '-RegenerateSupportModule' when executing 'test-module.ps1'. Otherwise please open a new PowerShell session and import this module again.`nAdditionally, this error could indicate that multiple incompatible versions of Azure PowerShell modules are installed on your system. For troubleshooting information, please see: https://aka.ms/azps-version-error" -ErrorAction Stop + } + Write-Information "Loaded Module '$($accountsModule.Name)'" + + # Load the private module dll + $null = Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Storage.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.Storage.Module]::Instance + + # Ask for the shared functionality table + $VTable = Register-AzModule + + # Tweaks the pipeline on module load + $instance.OnModuleLoad = $VTable.OnModuleLoad + + # Following two delegates are added for telemetry + $instance.GetTelemetryId = $VTable.GetTelemetryId + $instance.Telemetry = $VTable.Telemetry + + + # Tweaks the pipeline per call + $instance.OnNewRequest = $VTable.OnNewRequest + + # Gets shared parameter values + $instance.GetParameterValue = $VTable.GetParameterValue + + # Allows shared module to listen to events from this module + $instance.EventListener = $VTable.EventListener + + # Gets shared argument completers + $instance.ArgumentCompleter = $VTable.ArgumentCompleter + + # The name of the currently selected Azure profile + $instance.ProfileName = $VTable.ProfileName + + + # Load the custom module + $customModulePath = Join-Path $PSScriptRoot './custom/Az.Storage.custom.psm1' + if(Test-Path $customModulePath) { + $null = Import-Module -Name $customModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = Join-Path $PSScriptRoot './exports' + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } + + # Finalize initialization of this module + $instance.Init(); + Write-Information "Loaded Module '$($instance.Name)'" +# endregion diff --git a/swaggerci/storage/MSSharedLibKey.snk b/swaggerci/storage/MSSharedLibKey.snk new file mode 100644 index 000000000000..695f1b38774e Binary files /dev/null and b/swaggerci/storage/MSSharedLibKey.snk differ diff --git a/swaggerci/storage/README.md b/swaggerci/storage/README.md new file mode 100644 index 000000000000..d17697249e67 --- /dev/null +++ b/swaggerci/storage/README.md @@ -0,0 +1,27 @@ + +# Az.Storage +This directory contains the PowerShell module for the Storage service. + +--- +## Status +[![Az.Storage](https://img.shields.io/powershellgallery/v/Az.Storage.svg?style=flat-square&label=Az.Storage "Az.Storage")](https://www.powershellgallery.com/packages/Az.Storage/) + +## Info +- Modifiable: yes +- Generated: all +- Committed: yes +- Packaged: yes + +--- +## Detail +This module was primarily generated via [AutoRest](https://github.com/Azure/autorest) using the [PowerShell](https://github.com/Azure/autorest.powershell) extension. + +## Module Requirements +- [Az.Accounts module](https://www.powershellgallery.com/packages/Az.Accounts/), version 2.7.5 or greater + +## Authentication +AutoRest does not generate authentication code for the module. Authentication is handled via Az.Accounts by altering the HTTP payload before it is sent. + +## Development +For information on how to develop for `Az.Storage`, see [how-to.md](how-to.md). + diff --git a/swaggerci/storage/build-module.ps1 b/swaggerci/storage/build-module.ps1 new file mode 100644 index 000000000000..1b4b3c4d0245 --- /dev/null +++ b/swaggerci/storage/build-module.ps1 @@ -0,0 +1,153 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Run, [switch]$Test, [switch]$Docs, [switch]$Pack, [switch]$Code, [switch]$Release, [switch]$Debugger, [switch]$NoDocs) +$ErrorActionPreference = 'Stop' + +if($PSEdition -ne 'Core') { + Write-Error 'This script requires PowerShell Core to execute. [Note] Generated cmdlets will work in both PowerShell Core or Windows PowerShell.' +} + +if(-not $Isolated -and -not $Debugger) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + + if($LastExitCode -ne 0) { + # Build failed. Don't attempt to run the module. + return + } + + if($Test) { + . (Join-Path $PSScriptRoot 'test-module.ps1') + if($LastExitCode -ne 0) { + # Tests failed. Don't attempt to run the module. + return + } + } + + if($Docs) { + . (Join-Path $PSScriptRoot 'generate-help.ps1') + if($LastExitCode -ne 0) { + # Docs generation failed. Don't attempt to run the module. + return + } + } + + if($Pack) { + . (Join-Path $PSScriptRoot 'pack-module.ps1') + if($LastExitCode -ne 0) { + # Packing failed. Don't attempt to run the module. + return + } + } + + $runModulePath = Join-Path $PSScriptRoot 'run-module.ps1' + if($Code) { + . $runModulePath -Code + } elseif($Run) { + . $runModulePath + } else { + Write-Host -ForegroundColor Cyan "To run this module in an isolated PowerShell session, run the 'run-module.ps1' script or provide the '-Run' parameter to this script." + } + return +} + +$binFolder = Join-Path $PSScriptRoot 'bin' +$objFolder = Join-Path $PSScriptRoot 'obj' + +if(-not $Debugger) { + Write-Host -ForegroundColor Green 'Cleaning build folders...' + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path $binFolder, $objFolder + + if((Test-Path $binFolder) -or (Test-Path $objFolder)) { + Write-Host -ForegroundColor Cyan 'Did you forget to exit your isolated module session before rebuilding?' + Write-Error 'Unable to clean ''bin'' or ''obj'' folder. A process may have an open handle.' + } + + Write-Host -ForegroundColor Green 'Compiling module...' + $buildConfig = 'Debug' + if($Release) { + $buildConfig = 'Release' + } + dotnet publish $PSScriptRoot --verbosity quiet --configuration $buildConfig /nologo + if($LastExitCode -ne 0) { + Write-Error 'Compilation failed.' + } + + $null = Remove-Item -Recurse -ErrorAction SilentlyContinue -Path (Join-Path $binFolder 'Debug'), (Join-Path $binFolder 'Release') +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.Storage.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} + +# Load DLL to use build-time cmdlets +$null = Import-Module -Name $dll + +$modulePaths = $dll +$customPsm1 = Join-Path $PSScriptRoot 'custom/Az.Storage.custom.psm1' +if(Test-Path $customPsm1) { + $modulePaths = @($dll, $customPsm1) +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(Test-Path $exportsFolder) { + $null = Get-ChildItem -Path $exportsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $exportsFolder + +$internalFolder = Join-Path $PSScriptRoot 'internal' +if(Test-Path $internalFolder) { + $null = Get-ChildItem -Path $internalFolder -Recurse -Exclude '*.psm1', 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $internalFolder + +$psd1 = Join-Path $PSScriptRoot './Az.Storage.psd1' +$guid = Get-ModuleGuid -Psd1Path $psd1 +$moduleName = 'Az.Storage' +$examplesFolder = Join-Path $PSScriptRoot 'examples' +$null = New-Item -ItemType Directory -Force -Path $examplesFolder + +Write-Host -ForegroundColor Green 'Creating cmdlets for specified models...' +$modelCmdlets = @() +if ($modelCmdlets.Count -gt 0) { + . (Join-Path $PSScriptRoot 'create-model-cmdlets.ps1') + CreateModelCmdlet($modelCmdlets) +} + +if($NoDocs) { + Write-Host -ForegroundColor Green 'Creating exports...' + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ExcludeDocs -ExamplesFolder $examplesFolder +} else { + Write-Host -ForegroundColor Green 'Creating exports and docs...' + $moduleDescription = 'Microsoft Azure PowerShell: Storage cmdlets' + $docsFolder = Join-Path $PSScriptRoot 'docs' + if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue + } + $null = New-Item -ItemType Directory -Force -Path $docsFolder + Export-ProxyCmdlet -ModuleName $moduleName -ModulePath $modulePaths -ExportsFolder $exportsFolder -InternalFolder $internalFolder -ModuleDescription $moduleDescription -DocsFolder $docsFolder -ExamplesFolder $examplesFolder -ModuleGuid $guid +} + +Write-Host -ForegroundColor Green 'Creating format.ps1xml...' +$formatPs1xml = Join-Path $PSScriptRoot './Az.Storage.format.ps1xml' +Export-FormatPs1xml -FilePath $formatPs1xml + +Write-Host -ForegroundColor Green 'Creating psd1...' +$customFolder = Join-Path $PSScriptRoot 'custom' +Export-Psd1 -ExportsFolder $exportsFolder -CustomFolder $customFolder -Psd1Path $psd1 -ModuleGuid $guid + +Write-Host -ForegroundColor Green 'Creating test stubs...' +$testFolder = Join-Path $PSScriptRoot 'test' +$null = New-Item -ItemType Directory -Force -Path $testFolder +Export-TestStub -ModuleName $moduleName -ExportsFolder $exportsFolder -OutputFolder $testFolder + +Write-Host -ForegroundColor Green 'Creating example stubs...' +Export-ExampleStub -ExportsFolder $exportsFolder -OutputFolder $examplesFolder + +Write-Host -ForegroundColor Green '-------------Done-------------' diff --git a/swaggerci/storage/check-dependencies.ps1 b/swaggerci/storage/check-dependencies.ps1 new file mode 100644 index 000000000000..ec3055201a71 --- /dev/null +++ b/swaggerci/storage/check-dependencies.ps1 @@ -0,0 +1,57 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Accounts, [switch]$Pester, [switch]$Resources) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +function DownloadModule ([bool]$predicate, [string]$path, [string]$moduleName, [string]$versionMinimum, [string]$requiredVersion) { + if($predicate) { + $module = Get-Module -ListAvailable -Name $moduleName + if((-not $module) -or ($versionMinimum -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -ge [System.Version]$versionMinimum } | Measure-Object).Count -eq 0) -or ($requiredVersion -and ($module | ForEach-Object { $_.Version } | Where-Object { $_ -eq [System.Version]$requiredVersion } | Measure-Object).Count -eq 0)) { + $null = New-Item -ItemType Directory -Force -Path $path + Write-Host -ForegroundColor Green "Installing local $moduleName module into '$path'..." + if ($requiredVersion) { + Find-Module -Name $moduleName -RequiredVersion $requiredVersion -Repository PSGallery | Save-Module -Path $path + }elseif($versionMinimum) { + Find-Module -Name $moduleName -MinimumVersion $versionMinimum -Repository PSGallery | Save-Module -Path $path + } else { + Find-Module -Name $moduleName -Repository PSGallery | Save-Module -Path $path + } + } + } +} + +$ProgressPreference = 'SilentlyContinue' +$all = (@($Accounts.IsPresent, $Pester.IsPresent) | Select-Object -Unique | Measure-Object).Count -eq 1 + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +DownloadModule -predicate ($all -or $Accounts) -path $localModulesPath -moduleName 'Az.Accounts' -versionMinimum '2.7.5' +DownloadModule -predicate ($all -or $Pester) -path $localModulesPath -moduleName 'Pester' -requiredVersion '4.10.1' + +$tools = Join-Path $PSScriptRoot 'tools' +$resourceDir = Join-Path $tools 'Resources' +$resourceModule = Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psm1' + +if ($Resources.IsPresent -and ((-not (Test-Path -Path $resourceModule)) -or $RegenerateSupportModule.IsPresent)) { + Write-Host -ForegroundColor Green "Building local Resource module used for test..." + Set-Location $resourceDir + $null = autorest .\README.md --use:@autorest/powershell@3.0.414 --output-folder=$HOME/.PSSharedModules/Resources + $null = Copy-Item custom/* $HOME/.PSSharedModules/Resources/custom/ + Set-Location $HOME/.PSSharedModules/Resources + $null = .\build-module.ps1 + Set-Location $PSScriptRoot +} diff --git a/swaggerci/storage/create-model-cmdlets.ps1 b/swaggerci/storage/create-model-cmdlets.ps1 new file mode 100644 index 000000000000..cbd5e0d21633 --- /dev/null +++ b/swaggerci/storage/create-model-cmdlets.ps1 @@ -0,0 +1,163 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +function CreateModelCmdlet { + + param([string[]]$Models) + + if ($Models.Count -eq 0) + { + return + } + + $ModelCsPath = Join-Path (Join-Path $PSScriptRoot 'generated/api') 'Models' + $ModuleName = 'Storage' + $OutputDir = Join-Path $PSScriptRoot 'custom/autogen-model-cmdlets' + $null = New-Item -ItemType Directory -Force -Path $OutputDir + + $CsFiles = Get-ChildItem -Path $ModelCsPath -Recurse -Filter *.cs + $Content = '' + $null = $CsFiles | ForEach-Object -Process { if ($_.Name.Split('.').count -eq 2 ) + { $Content += get-content $_.fullname -raw + } } + + $Tree = [Microsoft.CodeAnalysis.CSharp.SyntaxFactory]::ParseCompilationUnit($Content) + $Nodes = $Tree.ChildNodes().ChildNodes() + foreach ($Model in $Models) + { + $InterfaceNode = $Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq "I$Model") } + if ($InterfaceNode.count -eq 0) { + continue + } + # through a queue, we iterate all the parent models. + $Queue = @($InterfaceNode) + $visited = @("I$Model") + $AllInterfaceNodes = @() + while ($Queue.count -ne 0) + { + $AllInterfaceNodes += $Queue[0] + # Baselist contains the direct parent models. + foreach ($parent in $Queue[0].BaseList.Types) + { + if (($parent.Type.Right.Identifier.Value -ne 'IJsonSerializable') -and (-not $visited.Contains($parent.Type.Right.Identifier.Value))) + { + $Queue = [Array]$Queue + ($Nodes | Where-Object { ($_.Keyword.value -eq 'interface') -and ($_.Identifier.value -eq $parent.Type.Right.Identifier.Value) }) + $visited = [Array]$visited + $parent.Type.Right.Identifier.Value + } + } + $first, $Queue = $Queue + } + + $Namespace = $InterfaceNode.Parent.Name + $ObjectType = $Model + $ObjectTypeWithNamespace = "${Namespace}.${ObjectType}" + # remove duplicated module name + if ($ObjectType.StartsWith($ModuleName)) { + $ModulePrefix = '' + } else { + $ModulePrefix = $ModuleName + } + $OutputPath = Join-Path -ChildPath "New-Az${ModulePrefix}${ObjectType}Object.ps1" -Path $OutputDir + + $ParameterDefineScriptList = New-Object System.Collections.Generic.List[string] + $ParameterAssignScriptList = New-Object System.Collections.Generic.List[string] + foreach ($Node in $AllInterfaceNodes) + { + foreach ($Member in $Node.Members) + { + $Arguments = $Member.AttributeLists.Attributes.ArgumentList.Arguments + $Required = $false + $Description = "" + $Readonly = $False + foreach ($Argument in $Arguments) + { + if ($Argument.NameEquals.Name.Identifier.Value -eq "Required") + { + $Required = $Argument.Expression.Token.Value + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Description") + { + $Description = $Argument.Expression.Token.Value.Trim('.').replace('"', '`"') + } + if ($Argument.NameEquals.Name.Identifier.Value -eq "Readonly") + { + $Readonly = $Argument.Expression.Token.Value + } + } + if ($Readonly) + { + continue + } + $Identifier = $Member.Identifier.Value + $Type = $Member.Type.ToString().replace('?', '').Split("::")[-1] + $ParameterDefinePropertyList = New-Object System.Collections.Generic.List[string] + if ($Required) + { + $ParameterDefinePropertyList.Add("Mandatory") + } + if ($Description -ne "") + { + $ParameterDefinePropertyList.Add("HelpMessage=`"${Description}.`"") + } + $ParameterDefineProperty = [System.String]::Join(", ", $ParameterDefinePropertyList) + # check whether completer is needed + $completer = ''; + if($Type.Split('.').Split('.')[-2] -eq 'Support') { + # If Type is an array, need to strip [] + $strippedType = $Type.Replace('[]', '') + $completer += "`n [ArgumentCompleter([${strippedType}])]" + } + $ParameterDefineScript = " + [Parameter($ParameterDefineProperty)]${completer} + [${Type}] + `$${Identifier}" + $ParameterDefineScriptList.Add($ParameterDefineScript) + $ParameterAssignScriptList.Add(" + if (`$PSBoundParameters.ContainsKey('${Identifier}')) { + `$Object.${Identifier} = `$${Identifier} + }") + } + } + $ParameterDefineScript = $ParameterDefineScriptList | Join-String -Separator "," + $ParameterAssignScript = $ParameterAssignScriptList | Join-String -Separator "" + + $Script = " +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create an in-memory object for ${ObjectType}. +.Description +Create an in-memory object for ${ObjectType}. + +.Outputs +${ObjectTypeWithNamespace} +.Link +https://docs.microsoft.com/en-us/powershell/module/az.${ModuleName}/new-Az${ModulePrefix}${ObjectType}Object +#> +function New-Az${ModulePrefix}${ObjectType}Object { + [OutputType('${ObjectTypeWithNamespace}')] + [CmdletBinding(PositionalBinding=`$false)] + Param( +${ParameterDefineScript} + ) + + process { + `$Object = [${ObjectTypeWithNamespace}]::New() +${ParameterAssignScript} + return `$Object + } +} +" + Set-Content -Path $OutputPath -Value $Script + } +} diff --git a/swaggerci/storage/custom/Az.Storage.custom.psm1 b/swaggerci/storage/custom/Az.Storage.custom.psm1 new file mode 100644 index 000000000000..95c295865eb6 --- /dev/null +++ b/swaggerci/storage/custom/Az.Storage.custom.psm1 @@ -0,0 +1,17 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Storage.private.dll') + + # Load the internal module + $internalModulePath = Join-Path $PSScriptRoot '../internal/Az.Storage.internal.psm1' + if(Test-Path $internalModulePath) { + $null = Import-Module -Name $internalModulePath + } + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export script cmdlets + Get-ChildItem -Path $PSScriptRoot -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + Export-ModuleMember -Function (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot) -Alias (Get-ScriptCmdlet -ScriptFolder $PSScriptRoot -AsAlias) +# endregion diff --git a/swaggerci/storage/custom/README.md b/swaggerci/storage/custom/README.md new file mode 100644 index 000000000000..b2cc24debd2e --- /dev/null +++ b/swaggerci/storage/custom/README.md @@ -0,0 +1,41 @@ +# Custom +This directory contains custom implementation for non-generated cmdlets for the `Az.Storage` module. Both scripts (`.ps1`) and C# files (`.cs`) can be implemented here. They will be used during the build process in `build-module.ps1`, and create cmdlets into the `../exports` folder. The only generated file into this folder is the `Az.Storage.custom.psm1`. This file should not be modified. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: yes + +## Details +For `Az.Storage` to use custom cmdlets, it does this two different ways. We **highly recommend** creating script cmdlets, as they are easier to write and allow access to the other exported cmdlets. C# cmdlets *cannot access exported cmdlets*. + +For C# cmdlets, they are compiled with the rest of the generated low-level cmdlets into the `./bin/Az.Storage.private.dll`. The names of the cmdlets (methods) and files must follow the `[cmdletName]_[variantName]` syntax used for generated cmdlets. The `variantName` is used as the `ParameterSetName`, so use something appropriate that doesn't clash with already created variant or parameter set names. You cannot use the `ParameterSetName` property in the `Parameter` attribute on C# cmdlets. Each cmdlet must be separated into variants using the same pattern as seen in the `generated/cmdlets` folder. + +For script cmdlets, these are loaded via the `Az.Storage.custom.psm1`. Then, during the build process, this module is loaded and processed in the same manner as the C# cmdlets. The fundamental difference is the script cmdlets use the `ParameterSetName` attribute and C# cmdlets do not. To create a script cmdlet variant of a generated cmdlet, simply decorate all parameters in the script with the new `ParameterSetName` in the `Parameter` attribute. This will appropriately treat each parameter set as a separate variant when processed to be exported during the build. + +## Purpose +This allows the modules to have cmdlets that were not defined in the REST specification. It also allows combining logic using generated cmdlets. This is a level of customization beyond what can be done using the [readme configuration options](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md) that are currently available. These custom cmdlets are then referenced by the cmdlets created at build-time in the `../exports` folder. + +## Usage +The easiest way currently to start developing custom cmdlets is to copy an existing cmdlet. For C# cmdlets, copy one from the `generated/cmdlets` folder. For script cmdlets, build the project using `build-module.ps1` and copy one of the scripts from the `../exports` folder. After that, if you want to add new parameter sets, follow the guidelines in the `Details` section above. For implementing a new cmdlets, at minimum, please keep these parameters: +- Break +- DefaultProfile +- HttpPipelineAppend +- HttpPipelinePrepend +- Proxy +- ProxyCredential +- ProxyUseDefaultCredentials + +These provide functionality to our HTTP pipeline and other useful features. In script, you can forward these parameters using `$PSBoundParameters` to the other cmdlets you're calling within `Az.Storage`. For C#, follow the usage seen in the `ProcessRecordAsync` method. + +### Attributes +For processing the cmdlets, we've created some additional attributes: +- `Microsoft.Azure.PowerShell.Cmdlets.Storage.DescriptionAttribute` + - Used in C# cmdlets to provide a high-level description of the cmdlet. This is propagated to reference documentation via [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) in the exported scripts. +- `Microsoft.Azure.PowerShell.Cmdlets.Storage.DoNotExportAttribute` + - Used in C# and script cmdlets to suppress creating an exported cmdlet at build-time. These cmdlets will *not be exposed* by `Az.Storage`. +- `Microsoft.Azure.PowerShell.Cmdlets.Storage.InternalExportAttribute` + - Used in C# cmdlets to route exported cmdlets to the `../internal`, which are *not exposed* by `Az.Storage`. For more information, see [README.md](../internal/README.md) in the `../internal` folder. +- `Microsoft.Azure.PowerShell.Cmdlets.Storage.ProfileAttribute` + - Used in C# and script cmdlets to define which Azure profiles the cmdlet supports. This is only supported for Azure (`--azure`) modules. \ No newline at end of file diff --git a/swaggerci/storage/docs/Az.Storage.md b/swaggerci/storage/docs/Az.Storage.md new file mode 100644 index 000000000000..3d50fe17a5a5 --- /dev/null +++ b/swaggerci/storage/docs/Az.Storage.md @@ -0,0 +1,257 @@ +--- +Module Name: Az.Storage +Module Guid: 25f42a87-85e3-4f19-ae4d-59507c3cee32 +Download Help Link: https://docs.microsoft.com/en-us/powershell/module/az.storage +Help Version: 1.0.0.0 +Locale: en-US +--- + +# Az.Storage Module +## Description +Microsoft Azure PowerShell: Storage cmdlets + +## Az.Storage Cmdlets +### [Clear-AzStorageBlobContainerLegalHold](Clear-AzStorageBlobContainerLegalHold.md) +Clears legal hold tags. +Clearing the same or non-existent tag results in an idempotent operation. +ClearLegalHold clears out only the specified tags in the request. + +### [Get-AzStorageAccount](Get-AzStorageAccount.md) +Lists all the storage accounts available under the subscription. +Note that storage keys are not returned; use the ListKeys operation for this. + +### [Get-AzStorageAccountKey](Get-AzStorageAccountKey.md) +Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + +### [Get-AzStorageAccountProperty](Get-AzStorageAccountProperty.md) +Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. +The ListKeys operation should be used to retrieve storage keys. + +### [Get-AzStorageAccountSas](Get-AzStorageAccountSas.md) +List SAS credentials of a storage account. + +### [Get-AzStorageAccountServiceSas](Get-AzStorageAccountServiceSas.md) +List service SAS credentials of a specific resource. + +### [Get-AzStorageBlobContainer](Get-AzStorageBlobContainer.md) +Gets properties of a specified container. + +### [Get-AzStorageBlobContainerImmutabilityPolicy](Get-AzStorageBlobContainerImmutabilityPolicy.md) +Gets the existing immutability policy along with the corresponding ETag in response headers and body. + +### [Get-AzStorageBlobInventoryPolicy](Get-AzStorageBlobInventoryPolicy.md) +Gets the blob inventory policy associated with the specified storage account. + +### [Get-AzStorageBlobService](Get-AzStorageBlobService.md) +List blob services of storage account. +It returns a collection of one object named default. + +### [Get-AzStorageBlobServiceProperty](Get-AzStorageBlobServiceProperty.md) +Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +### [Get-AzStorageDeletedAccount](Get-AzStorageDeletedAccount.md) +Get properties of specified deleted account resource. + +### [Get-AzStorageEncryptionScope](Get-AzStorageEncryptionScope.md) +Returns the properties for the specified encryption scope. + +### [Get-AzStorageFileService](Get-AzStorageFileService.md) +List all file services in storage accounts + +### [Get-AzStorageFileServiceProperty](Get-AzStorageFileServiceProperty.md) +Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + +### [Get-AzStorageFileShare](Get-AzStorageFileShare.md) +Gets properties of a specified share. + +### [Get-AzStorageLocalUser](Get-AzStorageLocalUser.md) +Get the local user of the storage account by username. + +### [Get-AzStorageLocalUserKey](Get-AzStorageLocalUserKey.md) +List SSH authorized keys and shared key of the local user. + +### [Get-AzStorageManagementPolicy](Get-AzStorageManagementPolicy.md) +Gets the managementpolicy associated with the specified storage account. + +### [Get-AzStorageObjectReplicationPolicy](Get-AzStorageObjectReplicationPolicy.md) +Get the object replication policy of the storage account by policy ID. + +### [Get-AzStoragePrivateEndpointConnection](Get-AzStoragePrivateEndpointConnection.md) +Gets the specified private endpoint connection associated with the storage account. + +### [Get-AzStoragePrivateLinkResource](Get-AzStoragePrivateLinkResource.md) +Gets the private link resources that need to be created for a storage account. + +### [Get-AzStorageQueue](Get-AzStorageQueue.md) +Gets the queue with the specified queue name, under the specified account if it exists. + +### [Get-AzStorageQueueService](Get-AzStorageQueueService.md) +List all queue services for the storage account + +### [Get-AzStorageQueueServiceProperty](Get-AzStorageQueueServiceProperty.md) +Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +### [Get-AzStorageSku](Get-AzStorageSku.md) +Lists the available SKUs supported by Microsoft.Storage for given subscription. + +### [Get-AzStorageTable](Get-AzStorageTable.md) +Gets the table with the specified table name, under the specified account if it exists. + +### [Get-AzStorageTableService](Get-AzStorageTableService.md) +List all table services for the storage account. + +### [Get-AzStorageTableServiceProperty](Get-AzStorageTableServiceProperty.md) +Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +### [Get-AzStorageUsage](Get-AzStorageUsage.md) +Gets the current usage count and the limit for the resources of the location under the subscription. + +### [Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration](Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md) +Abort live Migration of storage account to enable Hns + +### [Invoke-AzStorageExtendBlobContainerImmutabilityPolicy](Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md) +Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. +The only action allowed on a Locked policy will be this action. +ETag in If-Match is required for this operation. + +### [Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration](Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md) +Live Migration of storage account to enable Hns + +### [Invoke-AzStorageLeaseBlobContainer](Invoke-AzStorageLeaseBlobContainer.md) +The Lease Container operation establishes and manages a lock on a container for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. + +### [Invoke-AzStorageLeaseFileShare](Invoke-AzStorageLeaseFileShare.md) +The Lease Share operation establishes and manages a lock on a share for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. + +### [Invoke-AzStorageObjectBlobContainerLevelWorm](Invoke-AzStorageObjectBlobContainerLevelWorm.md) +This operation migrates a blob container from container level WORM to object level immutability enabled container. +Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. + +### [Lock-AzStorageBlobContainerImmutabilityPolicy](Lock-AzStorageBlobContainerImmutabilityPolicy.md) +Sets the ImmutabilityPolicy to Locked state. +The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. +ETag in If-Match is required for this operation. + +### [New-AzStorageAccount](New-AzStorageAccount.md) +Asynchronously creates a new storage account with the specified parameters. +If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. +If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + +### [New-AzStorageAccountKey](New-AzStorageAccountKey.md) +Regenerates one of the access keys or Kerberos keys for the specified storage account. + +### [New-AzStorageBlobContainer](New-AzStorageBlobContainer.md) +Creates a new container under the specified account as described by request body. +The container resource includes metadata and properties for that container. +It does not include a list of the blobs contained by the container. + +### [New-AzStorageBlobContainerImmutabilityPolicy](New-AzStorageBlobContainerImmutabilityPolicy.md) +Creates or updates an unlocked immutability policy. +ETag in If-Match is honored if given but not required for this operation. + +### [New-AzStorageBlobInventoryPolicy](New-AzStorageBlobInventoryPolicy.md) +Sets the blob inventory policy to the specified storage account. + +### [New-AzStorageFileShare](New-AzStorageFileShare.md) +Creates a new share under the specified account as described by request body. +The share resource includes metadata and properties for that share. +It does not include a list of the files contained by the share. + +### [New-AzStorageLocalUser](New-AzStorageLocalUser.md) +Create or update the properties of a local user associated with the storage account + +### [New-AzStorageLocalUserPassword](New-AzStorageLocalUserPassword.md) +Regenerate the local user SSH password. + +### [New-AzStorageManagementPolicy](New-AzStorageManagementPolicy.md) +Sets the managementpolicy to the specified storage account. + +### [New-AzStorageObjectReplicationPolicy](New-AzStorageObjectReplicationPolicy.md) +Create or update the object replication policy of the storage account. + +### [New-AzStorageQueue](New-AzStorageQueue.md) +Creates a new queue with the specified queue name, under the specified account. + +### [New-AzStorageTable](New-AzStorageTable.md) +Creates a new table with the specified table name, under the specified account. + +### [Remove-AzStorageAccount](Remove-AzStorageAccount.md) +Deletes a storage account in Microsoft Azure. + +### [Remove-AzStorageBlobContainer](Remove-AzStorageBlobContainer.md) +Deletes specified container under its account. + +### [Remove-AzStorageBlobContainerImmutabilityPolicy](Remove-AzStorageBlobContainerImmutabilityPolicy.md) +Aborts an unlocked immutability policy. +The response of delete has immutabilityPeriodSinceCreationInDays set to 0. +ETag in If-Match is required for this operation. +Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. + +### [Remove-AzStorageBlobInventoryPolicy](Remove-AzStorageBlobInventoryPolicy.md) +Deletes the blob inventory policy associated with the specified storage account. + +### [Remove-AzStorageFileShare](Remove-AzStorageFileShare.md) +Deletes specified share under its account. + +### [Remove-AzStorageLocalUser](Remove-AzStorageLocalUser.md) +Deletes the local user associated with the specified storage account. + +### [Remove-AzStorageManagementPolicy](Remove-AzStorageManagementPolicy.md) +Deletes the managementpolicy associated with the specified storage account. + +### [Remove-AzStorageObjectReplicationPolicy](Remove-AzStorageObjectReplicationPolicy.md) +Deletes the object replication policy associated with the specified storage account. + +### [Remove-AzStoragePrivateEndpointConnection](Remove-AzStoragePrivateEndpointConnection.md) +Deletes the specified private endpoint connection associated with the storage account. + +### [Remove-AzStorageQueue](Remove-AzStorageQueue.md) +Deletes the queue with the specified queue name, under the specified account if it exists. + +### [Remove-AzStorageTable](Remove-AzStorageTable.md) +Deletes the table with the specified table name, under the specified account if it exists. + +### [Restore-AzStorageAccountBlobRange](Restore-AzStorageAccountBlobRange.md) +Restore blobs in the specified blob ranges + +### [Restore-AzStorageFileShare](Restore-AzStorageFileShare.md) +Restore a file share within a valid retention days if share soft delete is enabled + +### [Revoke-AzStorageAccountUserDelegationKey](Revoke-AzStorageAccountUserDelegationKey.md) +Revoke user delegation keys. + +### [Test-AzStorageAccountNameAvailability](Test-AzStorageAccountNameAvailability.md) +Checks that the storage account name is valid and is not already in use. + +### [Update-AzStorageAccount](Update-AzStorageAccount.md) +The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +It can also be used to map the account to a custom domain. +Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. +In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. +The update of multiple properties is supported. +This call does not change the storage keys for the account. +If you want to change the storage account keys, use the regenerate keys operation. +The location and name of the storage account cannot be changed after creation. + +### [Update-AzStorageBlobContainer](Update-AzStorageBlobContainer.md) +Updates container properties as specified in request body. +Properties not mentioned in the request will be unchanged. +Update fails if the specified container doesn't already exist. + +### [Update-AzStorageEncryptionScope](Update-AzStorageEncryptionScope.md) +Update encryption scope properties as specified in the request body. +Update fails if the specified encryption scope does not already exist. + +### [Update-AzStorageFileShare](Update-AzStorageFileShare.md) +Updates share properties as specified in request body. +Properties not mentioned in the request will not be changed. +Update fails if the specified share does not already exist. + +### [Update-AzStorageQueue](Update-AzStorageQueue.md) +Creates a new queue with the specified queue name, under the specified account. + +### [Update-AzStorageTable](Update-AzStorageTable.md) +Creates a new table with the specified table name, under the specified account. + diff --git a/swaggerci/storage/docs/Clear-AzStorageBlobContainerLegalHold.md b/swaggerci/storage/docs/Clear-AzStorageBlobContainerLegalHold.md new file mode 100644 index 000000000000..e18511c32e3f --- /dev/null +++ b/swaggerci/storage/docs/Clear-AzStorageBlobContainerLegalHold.md @@ -0,0 +1,297 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/clear-azstorageblobcontainerlegalhold +schema: 2.0.0 +--- + +# Clear-AzStorageBlobContainerLegalHold + +## SYNOPSIS +Clears legal hold tags. +Clearing the same or non-existent tag results in an idempotent operation. +ClearLegalHold clears out only the specified tags in the request. + +## SYNTAX + +### ClearExpanded (Default) +``` +Clear-AzStorageBlobContainerLegalHold -AccountName -ContainerName + -ResourceGroupName -Tag [-SubscriptionId ] [-AllowProtectedAppendWritesAll] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Clear +``` +Clear-AzStorageBlobContainerLegalHold -AccountName -ContainerName + -ResourceGroupName -LegalHold [-SubscriptionId ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### ClearViaIdentity +``` +Clear-AzStorageBlobContainerLegalHold -InputObject -LegalHold + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### ClearViaIdentityExpanded +``` +Clear-AzStorageBlobContainerLegalHold -InputObject -Tag + [-AllowProtectedAppendWritesAll] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Clears legal hold tags. +Clearing the same or non-existent tag results in an idempotent operation. +ClearLegalHold clears out only the specified tags in the request. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Clear, ClearExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowProtectedAppendWritesAll +When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. +Only new blocks can be added and any existing blocks cannot be modified or deleted. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ClearExpanded, ClearViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Clear, ClearExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: ClearViaIdentity, ClearViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LegalHold +The LegalHold property of a blob container. +To construct, see NOTES section for LEGALHOLD properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold +Parameter Sets: Clear, ClearViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Clear, ClearExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Clear, ClearExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + +```yaml +Type: System.String[] +Parameter Sets: ClearExpanded, ClearViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`LEGALHOLD `: The LegalHold property of a blob container. + - `Tag `: Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + - `[AllowProtectedAppendWritesAll ]`: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageAccount.md b/swaggerci/storage/docs/Get-AzStorageAccount.md new file mode 100644 index 000000000000..e6cb2f4f0141 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageAccount.md @@ -0,0 +1,117 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccount +schema: 2.0.0 +--- + +# Get-AzStorageAccount + +## SYNOPSIS +Lists all the storage accounts available under the subscription. +Note that storage keys are not returned; use the ListKeys operation for this. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageAccount [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### List1 +``` +Get-AzStorageAccount -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Lists all the storage accounts available under the subscription. +Note that storage keys are not returned; use the ListKeys operation for this. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: List1 +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageAccountKey.md b/swaggerci/storage/docs/Get-AzStorageAccountKey.md new file mode 100644 index 000000000000..200ab551e1aa --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageAccountKey.md @@ -0,0 +1,172 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountkey +schema: 2.0.0 +--- + +# Get-AzStorageAccountKey + +## SYNOPSIS +Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + +## SYNTAX + +``` +Get-AzStorageAccountKey -AccountName -ResourceGroupName [-SubscriptionId ] + [-Expand ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Specifies type of the key to be listed. +Possible value is kerb. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageAccountProperty.md b/swaggerci/storage/docs/Get-AzStorageAccountProperty.md new file mode 100644 index 000000000000..489098f73c29 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageAccountProperty.md @@ -0,0 +1,197 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountproperty +schema: 2.0.0 +--- + +# Get-AzStorageAccountProperty + +## SYNOPSIS +Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. +The ListKeys operation should be used to retrieve storage keys. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageAccountProperty -AccountName -ResourceGroupName [-SubscriptionId ] + [-Expand ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageAccountProperty -InputObject [-Expand ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. +The ListKeys operation should be used to retrieve storage keys. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +May be used to expand the properties within account's properties. +By default, data is not included when fetching properties. +Currently we only support geoReplicationStats and blobRestoreStatus. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageAccountSas.md b/swaggerci/storage/docs/Get-AzStorageAccountSas.md new file mode 100644 index 000000000000..2d000dc4cb3f --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageAccountSas.md @@ -0,0 +1,321 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountsas +schema: 2.0.0 +--- + +# Get-AzStorageAccountSas + +## SYNOPSIS +List SAS credentials of a storage account. + +## SYNTAX + +### ListExpanded (Default) +``` +Get-AzStorageAccountSas -AccountName -ResourceGroupName -Permission + -ResourceType -Service -SharedAccessExpiryTime + [-SubscriptionId ] [-IPAddressOrRange ] [-KeyToSign ] [-Protocol ] + [-SharedAccessStartTime ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### List +``` +Get-AzStorageAccountSas -AccountName -ResourceGroupName -Parameter + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +List SAS credentials of a storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IPAddressOrRange +An IP address or a range of IP addresses from which to accept requests. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyToSign +The key to sign the account SAS token with. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +The parameters to list SAS credentials of a storage account. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters +Parameter Sets: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Permission +The signed permissions for the account SAS. +Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions +Parameter Sets: ListExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Protocol +The protocol permitted for a request made with the account SAS. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceType +The signed resource types that are accessible with the account SAS. +Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes +Parameter Sets: ListExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Service +The signed services accessible with the account SAS. +Possible values include: Blob (b), Queue (q), Table (t), File (f). + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services +Parameter Sets: ListExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharedAccessExpiryTime +The time at which the shared access signature becomes invalid. + +```yaml +Type: System.DateTime +Parameter Sets: ListExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharedAccessStartTime +The time at which the SAS becomes valid. + +```yaml +Type: System.DateTime +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`PARAMETER `: The parameters to list SAS credentials of a storage account. + - `Permission `: The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + - `ResourceType `: The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + - `Service `: The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + - `SharedAccessExpiryTime `: The time at which the shared access signature becomes invalid. + - `[IPAddressOrRange ]`: An IP address or a range of IP addresses from which to accept requests. + - `[KeyToSign ]`: The key to sign the account SAS token with. + - `[Protocol ]`: The protocol permitted for a request made with the account SAS. + - `[SharedAccessStartTime ]`: The time at which the SAS becomes valid. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageAccountServiceSas.md b/swaggerci/storage/docs/Get-AzStorageAccountServiceSas.md new file mode 100644 index 000000000000..e46c89d21a5d --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageAccountServiceSas.md @@ -0,0 +1,485 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountservicesas +schema: 2.0.0 +--- + +# Get-AzStorageAccountServiceSas + +## SYNOPSIS +List service SAS credentials of a specific resource. + +## SYNTAX + +### ListExpanded (Default) +``` +Get-AzStorageAccountServiceSas -AccountName -ResourceGroupName + -CanonicalizedResource [-SubscriptionId ] [-CacheControl ] + [-ContentDisposition ] [-ContentEncoding ] [-ContentLanguage ] + [-ContentType ] [-Identifier ] [-IPAddressOrRange ] [-KeyToSign ] + [-PartitionKeyEnd ] [-PartitionKeyStart ] [-Permission ] + [-Protocol ] [-Resource ] [-RowKeyEnd ] [-RowKeyStart ] + [-SharedAccessExpiryTime ] [-SharedAccessStartTime ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### List +``` +Get-AzStorageAccountServiceSas -AccountName -ResourceGroupName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +List service SAS credentials of a specific resource. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CacheControl +The response header override for cache control. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CanonicalizedResource +The canonical path to the signed resource. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentDisposition +The response header override for content disposition. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentEncoding +The response header override for content encoding. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentLanguage +The response header override for content language. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContentType +The response header override for content type. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Identifier +A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IPAddressOrRange +An IP address or a range of IP addresses from which to accept requests. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyToSign +The key to sign the account SAS token with. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +The parameters to list service SAS credentials of a specific resource. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters +Parameter Sets: List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PartitionKeyEnd +The end of partition key. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PartitionKeyStart +The start of partition key. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Permission +The signed permissions for the service SAS. +Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Protocol +The protocol permitted for a request made with the account SAS. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Resource +The signed services accessible with the service SAS. +Possible values include: Blob (b), Container (c), File (f), Share (s). + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RowKeyEnd +The end of row key. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RowKeyStart +The start of row key. + +```yaml +Type: System.String +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharedAccessExpiryTime +The time at which the shared access signature becomes invalid. + +```yaml +Type: System.DateTime +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SharedAccessStartTime +The time at which the SAS becomes valid. + +```yaml +Type: System.DateTime +Parameter Sets: ListExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`PARAMETER `: The parameters to list service SAS credentials of a specific resource. + - `CanonicalizedResource `: The canonical path to the signed resource. + - `[CacheControl ]`: The response header override for cache control. + - `[ContentDisposition ]`: The response header override for content disposition. + - `[ContentEncoding ]`: The response header override for content encoding. + - `[ContentLanguage ]`: The response header override for content language. + - `[ContentType ]`: The response header override for content type. + - `[IPAddressOrRange ]`: An IP address or a range of IP addresses from which to accept requests. + - `[Identifier ]`: A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + - `[KeyToSign ]`: The key to sign the account SAS token with. + - `[PartitionKeyEnd ]`: The end of partition key. + - `[PartitionKeyStart ]`: The start of partition key. + - `[Permission ]`: The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + - `[Protocol ]`: The protocol permitted for a request made with the account SAS. + - `[Resource ]`: The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). + - `[RowKeyEnd ]`: The end of row key. + - `[RowKeyStart ]`: The start of row key. + - `[SharedAccessExpiryTime ]`: The time at which the shared access signature becomes invalid. + - `[SharedAccessStartTime ]`: The time at which the SAS becomes valid. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageBlobContainer.md b/swaggerci/storage/docs/Get-AzStorageBlobContainer.md new file mode 100644 index 000000000000..848dc869de4a --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageBlobContainer.md @@ -0,0 +1,250 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobcontainer +schema: 2.0.0 +--- + +# Get-AzStorageBlobContainer + +## SYNOPSIS +Gets properties of a specified container. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageBlobContainer -AccountName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-Include ] [-Maxpagesize ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzStorageBlobContainer -AccountName -ContainerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageBlobContainer -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets properties of a specified container. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Optional. +When specified, only container names starting with the filter will be listed. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Include +Optional, used to include the properties for soft deleted blob containers. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Maxpagesize +Optional. +Specified maximum number of containers that can be included in the list. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/docs/Get-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..443f16caabc4 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,213 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobcontainerimmutabilitypolicy +schema: 2.0.0 +--- + +# Get-AzStorageBlobContainerImmutabilityPolicy + +## SYNOPSIS +Gets the existing immutability policy along with the corresponding ETag in response headers and body. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageBlobContainerImmutabilityPolicy -AccountName -ContainerName + -ResourceGroupName [-SubscriptionId ] [-IfMatch ] [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzStorageBlobContainerImmutabilityPolicy -InputObject [-IfMatch ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the existing immutability policy along with the corresponding ETag in response headers and body. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The entity state (ETag) version of the immutability policy to update. +A value of "*" can be used to apply the operation only if the immutability policy already exists. +If omitted, this operation will always be applied. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageBlobInventoryPolicy.md b/swaggerci/storage/docs/Get-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..be84147a2580 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,184 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobinventorypolicy +schema: 2.0.0 +--- + +# Get-AzStorageBlobInventoryPolicy + +## SYNOPSIS +Gets the blob inventory policy associated with the specified storage account. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageBlobInventoryPolicy -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageBlobInventoryPolicy -InputObject [-DefaultProfile ] + [] +``` + +### List +``` +Get-AzStorageBlobInventoryPolicy -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the blob inventory policy associated with the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageBlobService.md b/swaggerci/storage/docs/Get-AzStorageBlobService.md new file mode 100644 index 000000000000..f2cd318995ab --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageBlobService.md @@ -0,0 +1,127 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobservice +schema: 2.0.0 +--- + +# Get-AzStorageBlobService + +## SYNOPSIS +List blob services of storage account. +It returns a collection of one object named default. + +## SYNTAX + +``` +Get-AzStorageBlobService -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +List blob services of storage account. +It returns a collection of one object named default. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageBlobServiceProperty.md b/swaggerci/storage/docs/Get-AzStorageBlobServiceProperty.md new file mode 100644 index 000000000000..bcf3790729ec --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageBlobServiceProperty.md @@ -0,0 +1,178 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobserviceproperty +schema: 2.0.0 +--- + +# Get-AzStorageBlobServiceProperty + +## SYNOPSIS +Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageBlobServiceProperty -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageBlobServiceProperty -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageDeletedAccount.md b/swaggerci/storage/docs/Get-AzStorageDeletedAccount.md new file mode 100644 index 000000000000..5d05214985e8 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageDeletedAccount.md @@ -0,0 +1,180 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragedeletedaccount +schema: 2.0.0 +--- + +# Get-AzStorageDeletedAccount + +## SYNOPSIS +Get properties of specified deleted account resource. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageDeletedAccount [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageDeletedAccount -Location -Name [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageDeletedAccount -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get properties of specified deleted account resource. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Location +The location of the deleted storage account. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +Name of the deleted storage account. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: DeletedAccountName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageEncryptionScope.md b/swaggerci/storage/docs/Get-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..825d781affa3 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageEncryptionScope.md @@ -0,0 +1,200 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageencryptionscope +schema: 2.0.0 +--- + +# Get-AzStorageEncryptionScope + +## SYNOPSIS +Returns the properties for the specified encryption scope. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageEncryptionScope -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageEncryptionScope -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageEncryptionScope -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Returns the properties for the specified encryption scope. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the encryption scope within the specified storage account. +Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: EncryptionScopeName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageFileService.md b/swaggerci/storage/docs/Get-AzStorageFileService.md new file mode 100644 index 000000000000..027b71afa796 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageFileService.md @@ -0,0 +1,125 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileservice +schema: 2.0.0 +--- + +# Get-AzStorageFileService + +## SYNOPSIS +List all file services in storage accounts + +## SYNTAX + +``` +Get-AzStorageFileService -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +List all file services in storage accounts + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageFileServiceProperty.md b/swaggerci/storage/docs/Get-AzStorageFileServiceProperty.md new file mode 100644 index 000000000000..2cda38113deb --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageFileServiceProperty.md @@ -0,0 +1,178 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileserviceproperty +schema: 2.0.0 +--- + +# Get-AzStorageFileServiceProperty + +## SYNOPSIS +Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageFileServiceProperty -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageFileServiceProperty -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageFileShare.md b/swaggerci/storage/docs/Get-AzStorageFileShare.md new file mode 100644 index 000000000000..93fa592923ba --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageFileShare.md @@ -0,0 +1,269 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileshare +schema: 2.0.0 +--- + +# Get-AzStorageFileShare + +## SYNOPSIS +Gets properties of a specified share. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageFileShare -AccountName -ResourceGroupName [-SubscriptionId ] + [-Expand ] [-Filter ] [-Maxpagesize ] [-DefaultProfile ] + [] +``` + +### Get +``` +Get-AzStorageFileShare -AccountName -ResourceGroupName -ShareName + [-SubscriptionId ] [-Expand ] [-XmsSnapshot ] [-DefaultProfile ] + [] +``` + +### GetViaIdentity +``` +Get-AzStorageFileShare -InputObject [-Expand ] [-XmsSnapshot ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets properties of a specified share. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Optional, used to expand the properties within share's properties. +Valid values are: stats. +Should be passed as a string with delimiter ','. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Optional. +When specified, only share names starting with the filter will be listed. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Maxpagesize +Optional. +Specified maximum number of shares that can be included in the list. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The name of the file share within the specified storage account. +File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -XmsSnapshot +Optional, used to retrieve properties of a snapshot. + +```yaml +Type: System.String +Parameter Sets: Get, GetViaIdentity +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageLocalUser.md b/swaggerci/storage/docs/Get-AzStorageLocalUser.md new file mode 100644 index 000000000000..eb1f8a72e31b --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageLocalUser.md @@ -0,0 +1,200 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragelocaluser +schema: 2.0.0 +--- + +# Get-AzStorageLocalUser + +## SYNOPSIS +Get the local user of the storage account by username. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageLocalUser -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageLocalUser -AccountName -ResourceGroupName -Username + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageLocalUser -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Get the local user of the storage account by username. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +The name of local user. +The username must contain lowercase letters and numbers only. +It must be unique only within the storage account. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageLocalUserKey.md b/swaggerci/storage/docs/Get-AzStorageLocalUserKey.md new file mode 100644 index 000000000000..5efad60b5112 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageLocalUserKey.md @@ -0,0 +1,173 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragelocaluserkey +schema: 2.0.0 +--- + +# Get-AzStorageLocalUserKey + +## SYNOPSIS +List SSH authorized keys and shared key of the local user. + +## SYNTAX + +``` +Get-AzStorageLocalUserKey -AccountName -ResourceGroupName -Username + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +List SSH authorized keys and shared key of the local user. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +The name of local user. +The username must contain lowercase letters and numbers only. +It must be unique only within the storage account. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageManagementPolicy.md b/swaggerci/storage/docs/Get-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..ca79a226920b --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageManagementPolicy.md @@ -0,0 +1,178 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragemanagementpolicy +schema: 2.0.0 +--- + +# Get-AzStorageManagementPolicy + +## SYNOPSIS +Gets the managementpolicy associated with the specified storage account. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageManagementPolicy -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageManagementPolicy -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the managementpolicy associated with the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageObjectReplicationPolicy.md b/swaggerci/storage/docs/Get-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..e036b6ea4153 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,202 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageobjectreplicationpolicy +schema: 2.0.0 +--- + +# Get-AzStorageObjectReplicationPolicy + +## SYNOPSIS +Get the object replication policy of the storage account by policy ID. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageObjectReplicationPolicy -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageObjectReplicationPolicy -AccountName -Id -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageObjectReplicationPolicy -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Get the object replication policy of the storage account by policy ID. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +For the destination account, provide the value 'default'. +Configure the policy on the destination account first. +For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. +The policy is downloaded as a JSON file. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: ObjectReplicationPolicyId + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStoragePrivateEndpointConnection.md b/swaggerci/storage/docs/Get-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..5617efe19521 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStoragePrivateEndpointConnection.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageprivateendpointconnection +schema: 2.0.0 +--- + +# Get-AzStoragePrivateEndpointConnection + +## SYNOPSIS +Gets the specified private endpoint connection associated with the storage account. + +## SYNTAX + +### List (Default) +``` +Get-AzStoragePrivateEndpointConnection -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStoragePrivateEndpointConnection -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStoragePrivateEndpointConnection -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the specified private endpoint connection associated with the storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the private endpoint connection associated with the Azure resource + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: PrivateEndpointConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStoragePrivateLinkResource.md b/swaggerci/storage/docs/Get-AzStoragePrivateLinkResource.md new file mode 100644 index 000000000000..f3ef4f17d1a8 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStoragePrivateLinkResource.md @@ -0,0 +1,125 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageprivatelinkresource +schema: 2.0.0 +--- + +# Get-AzStoragePrivateLinkResource + +## SYNOPSIS +Gets the private link resources that need to be created for a storage account. + +## SYNTAX + +``` +Get-AzStoragePrivateLinkResource -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the private link resources that need to be created for a storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageQueue.md b/swaggerci/storage/docs/Get-AzStorageQueue.md new file mode 100644 index 000000000000..c29dff51a46c --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageQueue.md @@ -0,0 +1,230 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeue +schema: 2.0.0 +--- + +# Get-AzStorageQueue + +## SYNOPSIS +Gets the queue with the specified queue name, under the specified account if it exists. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageQueue -AccountName -ResourceGroupName [-SubscriptionId ] + [-Filter ] [-Maxpagesize ] [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageQueue -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageQueue -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the queue with the specified queue name, under the specified account if it exists. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Filter +Optional, When specified, only the queues with a name starting with the given filter will be listed. + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Maxpagesize +Optional, a maximum number of queues that should be included in a list queue response + +```yaml +Type: System.String +Parameter Sets: List +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: QueueName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageQueueService.md b/swaggerci/storage/docs/Get-AzStorageQueueService.md new file mode 100644 index 000000000000..147450fcb07e --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageQueueService.md @@ -0,0 +1,125 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeueservice +schema: 2.0.0 +--- + +# Get-AzStorageQueueService + +## SYNOPSIS +List all queue services for the storage account + +## SYNTAX + +``` +Get-AzStorageQueueService -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +List all queue services for the storage account + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageQueueServiceProperty.md b/swaggerci/storage/docs/Get-AzStorageQueueServiceProperty.md new file mode 100644 index 000000000000..a65d4a729813 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageQueueServiceProperty.md @@ -0,0 +1,178 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeueserviceproperty +schema: 2.0.0 +--- + +# Get-AzStorageQueueServiceProperty + +## SYNOPSIS +Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageQueueServiceProperty -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageQueueServiceProperty -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageSku.md b/swaggerci/storage/docs/Get-AzStorageSku.md new file mode 100644 index 000000000000..02720e812e07 --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageSku.md @@ -0,0 +1,92 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragesku +schema: 2.0.0 +--- + +# Get-AzStorageSku + +## SYNOPSIS +Lists the available SKUs supported by Microsoft.Storage for given subscription. + +## SYNTAX + +``` +Get-AzStorageSku [-SubscriptionId ] [-DefaultProfile ] [] +``` + +## DESCRIPTION +Lists the available SKUs supported by Microsoft.Storage for given subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageTable.md b/swaggerci/storage/docs/Get-AzStorageTable.md new file mode 100644 index 000000000000..188e390e9b6c --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageTable.md @@ -0,0 +1,198 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetable +schema: 2.0.0 +--- + +# Get-AzStorageTable + +## SYNOPSIS +Gets the table with the specified table name, under the specified account if it exists. + +## SYNTAX + +### List (Default) +``` +Get-AzStorageTable -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +### Get +``` +Get-AzStorageTable -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageTable -InputObject [-DefaultProfile ] [] +``` + +## DESCRIPTION +Gets the table with the specified table name, under the specified account if it exists. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: TableName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get, List +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get, List +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageTableService.md b/swaggerci/storage/docs/Get-AzStorageTableService.md new file mode 100644 index 000000000000..dca037ec578b --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageTableService.md @@ -0,0 +1,125 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetableservice +schema: 2.0.0 +--- + +# Get-AzStorageTableService + +## SYNOPSIS +List all table services for the storage account. + +## SYNTAX + +``` +Get-AzStorageTableService -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [] +``` + +## DESCRIPTION +List all table services for the storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageTableServiceProperty.md b/swaggerci/storage/docs/Get-AzStorageTableServiceProperty.md new file mode 100644 index 000000000000..70027481d9bc --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageTableServiceProperty.md @@ -0,0 +1,178 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetableserviceproperty +schema: 2.0.0 +--- + +# Get-AzStorageTableServiceProperty + +## SYNOPSIS +Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +## SYNTAX + +### Get (Default) +``` +Get-AzStorageTableServiceProperty -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [] +``` + +### GetViaIdentity +``` +Get-AzStorageTableServiceProperty -InputObject [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: GetViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Get +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: Get +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Get-AzStorageUsage.md b/swaggerci/storage/docs/Get-AzStorageUsage.md new file mode 100644 index 000000000000..fe2dc8aef55b --- /dev/null +++ b/swaggerci/storage/docs/Get-AzStorageUsage.md @@ -0,0 +1,108 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageusage +schema: 2.0.0 +--- + +# Get-AzStorageUsage + +## SYNOPSIS +Gets the current usage count and the limit for the resources of the location under the subscription. + +## SYNTAX + +``` +Get-AzStorageUsage -Location [-SubscriptionId ] [-DefaultProfile ] + [] +``` + +## DESCRIPTION +Gets the current usage count and the limit for the resources of the location under the subscription. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +The location of the Azure Storage resource. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md b/swaggerci/storage/docs/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md new file mode 100644 index 000000000000..e45f9fa75898 --- /dev/null +++ b/swaggerci/storage/docs/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md @@ -0,0 +1,255 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageabortstorageaccounthierarchicalnamespacemigration +schema: 2.0.0 +--- + +# Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration + +## SYNOPSIS +Abort live Migration of storage account to enable Hns + +## SYNTAX + +### Abort (Default) +``` +Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration -AccountName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### AbortViaIdentity +``` +Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration -InputObject + [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Abort live Migration of storage account to enable Hns + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: AbortViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Abort +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md b/swaggerci/storage/docs/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..ece8bb8a54be --- /dev/null +++ b/swaggerci/storage/docs/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md @@ -0,0 +1,339 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageextendblobcontainerimmutabilitypolicy +schema: 2.0.0 +--- + +# Invoke-AzStorageExtendBlobContainerImmutabilityPolicy + +## SYNOPSIS +Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. +The only action allowed on a Locked policy will be this action. +ETag in If-Match is required for this operation. + +## SYNTAX + +### ExtendExpanded (Default) +``` +Invoke-AzStorageExtendBlobContainerImmutabilityPolicy -AccountName -ContainerName + -ResourceGroupName -IfMatch [-SubscriptionId ] [-AllowProtectedAppendWrite] + [-AllowProtectedAppendWritesAll] [-ImmutabilityPeriodSinceCreationInDay ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### Extend +``` +Invoke-AzStorageExtendBlobContainerImmutabilityPolicy -AccountName -ContainerName + -ResourceGroupName -IfMatch -Parameter [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### ExtendViaIdentity +``` +Invoke-AzStorageExtendBlobContainerImmutabilityPolicy -InputObject -IfMatch + -Parameter [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### ExtendViaIdentityExpanded +``` +Invoke-AzStorageExtendBlobContainerImmutabilityPolicy -InputObject -IfMatch + [-AllowProtectedAppendWrite] [-AllowProtectedAppendWritesAll] [-ImmutabilityPeriodSinceCreationInDay ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. +The only action allowed on a Locked policy will be this action. +ETag in If-Match is required for this operation. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Extend, ExtendExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowProtectedAppendWrite +This property can only be changed for unlocked time-based retention policies. +When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. +Only new blocks can be added and any existing blocks cannot be modified or deleted. +This property cannot be changed with ExtendImmutabilityPolicy API. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ExtendExpanded, ExtendViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowProtectedAppendWritesAll +This property can only be changed for unlocked time-based retention policies. +When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. +Only new blocks can be added and any existing blocks cannot be modified or deleted. +This property cannot be changed with ExtendImmutabilityPolicy API. +The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: ExtendExpanded, ExtendViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Extend, ExtendExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The entity state (ETag) version of the immutability policy to update. +A value of "*" can be used to apply the operation only if the immutability policy already exists. +If omitted, this operation will always be applied. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPeriodSinceCreationInDay +The immutability period for the blobs in the container since the policy creation, in days. + +```yaml +Type: System.Int32 +Parameter Sets: ExtendExpanded, ExtendViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: ExtendViaIdentity, ExtendViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Parameter +The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +Parameter Sets: Extend, ExtendViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Extend, ExtendExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Extend, ExtendExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`PARAMETER `: The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + - `[AllowProtectedAppendWrite ]`: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + - `[AllowProtectedAppendWritesAll ]`: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + - `[ETag ]`: + - `[ImmutabilityPeriodSinceCreationInDay ]`: The immutability period for the blobs in the container since the policy creation, in days. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md b/swaggerci/storage/docs/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md new file mode 100644 index 000000000000..4a4437b6a95f --- /dev/null +++ b/swaggerci/storage/docs/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md @@ -0,0 +1,273 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstoragehierarchicalstorageaccountnamespacemigration +schema: 2.0.0 +--- + +# Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration + +## SYNOPSIS +Live Migration of storage account to enable Hns + +## SYNTAX + +### Hierarchical (Default) +``` +Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration -AccountName -ResourceGroupName + -RequestType [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +### HierarchicalViaIdentity +``` +Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration -InputObject + -RequestType [-DefaultProfile ] [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Live Migration of storage account to enable Hns + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Hierarchical +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: HierarchicalViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RequestType +Required. +Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. +The validation request will validate the migration whereas the hydration request will migrate the account. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Hierarchical +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Hierarchical +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Invoke-AzStorageLeaseBlobContainer.md b/swaggerci/storage/docs/Invoke-AzStorageLeaseBlobContainer.md new file mode 100644 index 000000000000..baa1618acc41 --- /dev/null +++ b/swaggerci/storage/docs/Invoke-AzStorageLeaseBlobContainer.md @@ -0,0 +1,349 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageleaseblobcontainer +schema: 2.0.0 +--- + +# Invoke-AzStorageLeaseBlobContainer + +## SYNOPSIS +The Lease Container operation establishes and manages a lock on a container for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. + +## SYNTAX + +### LeaseExpanded (Default) +``` +Invoke-AzStorageLeaseBlobContainer -AccountName -ContainerName -ResourceGroupName + -Action [-SubscriptionId ] [-BreakPeriod ] [-LeaseDuration ] + [-LeaseId ] [-ProposedLeaseId ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### Lease +``` +Invoke-AzStorageLeaseBlobContainer -AccountName -ContainerName -ResourceGroupName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### LeaseViaIdentity +``` +Invoke-AzStorageLeaseBlobContainer -InputObject -Parameter + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### LeaseViaIdentityExpanded +``` +Invoke-AzStorageLeaseBlobContainer -InputObject -Action + [-BreakPeriod ] [-LeaseDuration ] [-LeaseId ] [-ProposedLeaseId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The Lease Container operation establishes and manages a lock on a container for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Action +Specifies the lease action. +Can be one of the available actions. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BreakPeriod +Optional. +For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + +```yaml +Type: System.Int32 +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: LeaseViaIdentity, LeaseViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LeaseDuration +Required for acquire. +Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + +```yaml +Type: System.Int32 +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LeaseId +Identifies the lease. +Can be specified in any valid GUID string format. + +```yaml +Type: System.String +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Lease Container request schema. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 +Parameter Sets: Lease, LeaseViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ProposedLeaseId +Optional for acquire, required for change. +Proposed lease ID, in a GUID string format. + +```yaml +Type: System.String +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`PARAMETER `: Lease Container request schema. + - `Action `: Specifies the lease action. Can be one of the available actions. + - `[BreakPeriod ]`: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + - `[LeaseDuration ]`: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + - `[LeaseId ]`: Identifies the lease. Can be specified in any valid GUID string format. + - `[ProposedLeaseId ]`: Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Invoke-AzStorageLeaseFileShare.md b/swaggerci/storage/docs/Invoke-AzStorageLeaseFileShare.md new file mode 100644 index 000000000000..b4182be50d74 --- /dev/null +++ b/swaggerci/storage/docs/Invoke-AzStorageLeaseFileShare.md @@ -0,0 +1,365 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageleasefileshare +schema: 2.0.0 +--- + +# Invoke-AzStorageLeaseFileShare + +## SYNOPSIS +The Lease Share operation establishes and manages a lock on a share for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. + +## SYNTAX + +### LeaseExpanded (Default) +``` +Invoke-AzStorageLeaseFileShare -AccountName -ResourceGroupName -ShareName + -Action [-SubscriptionId ] [-XmsSnapshot ] [-BreakPeriod ] + [-LeaseDuration ] [-LeaseId ] [-ProposedLeaseId ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### Lease +``` +Invoke-AzStorageLeaseFileShare -AccountName -ResourceGroupName -ShareName + -Parameter [-SubscriptionId ] [-XmsSnapshot ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### LeaseViaIdentity +``` +Invoke-AzStorageLeaseFileShare -InputObject -Parameter + [-XmsSnapshot ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### LeaseViaIdentityExpanded +``` +Invoke-AzStorageLeaseFileShare -InputObject -Action + [-XmsSnapshot ] [-BreakPeriod ] [-LeaseDuration ] [-LeaseId ] + [-ProposedLeaseId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +The Lease Share operation establishes and manages a lock on a share for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Action +Specifies the lease action. +Can be one of the available actions. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BreakPeriod +Optional. +For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + +```yaml +Type: System.Int32 +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: LeaseViaIdentity, LeaseViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -LeaseDuration +Required for acquire. +Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + +```yaml +Type: System.Int32 +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LeaseId +Identifies the lease. +Can be specified in any valid GUID string format. + +```yaml +Type: System.String +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Lease Share request schema. +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest +Parameter Sets: Lease, LeaseViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ProposedLeaseId +Optional for acquire, required for change. +Proposed lease ID, in a GUID string format. + +```yaml +Type: System.String +Parameter Sets: LeaseExpanded, LeaseViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The name of the file share within the specified storage account. +File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Lease, LeaseExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -XmsSnapshot +Optional. +Specify the snapshot time to lease a snapshot. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`PARAMETER `: Lease Share request schema. + - `Action `: Specifies the lease action. Can be one of the available actions. + - `[BreakPeriod ]`: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + - `[LeaseDuration ]`: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + - `[LeaseId ]`: Identifies the lease. Can be specified in any valid GUID string format. + - `[ProposedLeaseId ]`: Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Invoke-AzStorageObjectBlobContainerLevelWorm.md b/swaggerci/storage/docs/Invoke-AzStorageObjectBlobContainerLevelWorm.md new file mode 100644 index 000000000000..5103615194c5 --- /dev/null +++ b/swaggerci/storage/docs/Invoke-AzStorageObjectBlobContainerLevelWorm.md @@ -0,0 +1,274 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageobjectblobcontainerlevelworm +schema: 2.0.0 +--- + +# Invoke-AzStorageObjectBlobContainerLevelWorm + +## SYNOPSIS +This operation migrates a blob container from container level WORM to object level immutability enabled container. +Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. + +## SYNTAX + +### Object (Default) +``` +Invoke-AzStorageObjectBlobContainerLevelWorm -AccountName -ContainerName + -ResourceGroupName [-SubscriptionId ] [-DefaultProfile ] [-AsJob] [-NoWait] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### ObjectViaIdentity +``` +Invoke-AzStorageObjectBlobContainerLevelWorm -InputObject [-DefaultProfile ] + [-AsJob] [-NoWait] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +This operation migrates a blob container from container level WORM to object level immutability enabled container. +Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Object +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Object +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: ObjectViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Object +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Object +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Lock-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/docs/Lock-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..4bcfe687bdbb --- /dev/null +++ b/swaggerci/storage/docs/Lock-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,248 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/lock-azstorageblobcontainerimmutabilitypolicy +schema: 2.0.0 +--- + +# Lock-AzStorageBlobContainerImmutabilityPolicy + +## SYNOPSIS +Sets the ImmutabilityPolicy to Locked state. +The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. +ETag in If-Match is required for this operation. + +## SYNTAX + +### Lock (Default) +``` +Lock-AzStorageBlobContainerImmutabilityPolicy -AccountName -ContainerName + -ResourceGroupName -IfMatch [-SubscriptionId ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### LockViaIdentity +``` +Lock-AzStorageBlobContainerImmutabilityPolicy -InputObject -IfMatch + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Sets the ImmutabilityPolicy to Locked state. +The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. +ETag in If-Match is required for this operation. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Lock +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Lock +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The entity state (ETag) version of the immutability policy to update. +A value of "*" can be used to apply the operation only if the immutability policy already exists. +If omitted, this operation will always be applied. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: LockViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Lock +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Lock +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageAccount.md b/swaggerci/storage/docs/New-AzStorageAccount.md new file mode 100644 index 000000000000..c1c3aa0b161f --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageAccount.md @@ -0,0 +1,1037 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageaccount +schema: 2.0.0 +--- + +# New-AzStorageAccount + +## SYNOPSIS +Asynchronously creates a new storage account with the specified parameters. +If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. +If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + +## SYNTAX + +``` +New-AzStorageAccount -AccountName -ResourceGroupName -Kind -Location + -SkuName [-SubscriptionId ] [-AccessTier ] + [-ActiveDirectoryPropertyAccountType ] [-ActiveDirectoryPropertyAzureStorageSid ] + [-ActiveDirectoryPropertyDomainGuid ] [-ActiveDirectoryPropertyDomainName ] + [-ActiveDirectoryPropertyDomainSid ] [-ActiveDirectoryPropertyForestName ] + [-ActiveDirectoryPropertyNetBiosDomainName ] [-ActiveDirectoryPropertySamAccountName ] + [-AllowBlobPublicAccess] [-AllowCrossTenantReplication] [-AllowedCopyScope ] + [-AllowSharedKeyAccess] + [-AzureFileIdentityBasedAuthenticationDefaultSharePermission ] + [-AzureFileIdentityBasedAuthenticationDirectoryServiceOption ] + [-CustomDomainName ] [-CustomDomainUseSubDomainName] [-DefaultToOAuthAuthentication] + [-DnsEndpointType ] [-EnableHttpsTrafficOnly] [-EnableNfsV3] [-Encryption ] + [-ExtendedLocationName ] [-ExtendedLocationType ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-ImmutabilityPolicyAllowProtectedAppendWrite] + [-ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ] + [-ImmutabilityPolicyState ] [-ImmutableStorageWithVersioningEnabled] + [-IsHnsEnabled] [-IsLocalUserEnabled] [-IsSftpEnabled] [-KeyPolicyKeyExpirationPeriodInDay ] + [-LargeFileSharesState ] [-MinimumTlsVersion ] + [-NetworkRuleSetBypass ] [-NetworkRuleSetDefaultAction ] + [-NetworkRuleSetIPRule ] [-NetworkRuleSetResourceAccessRule ] + [-NetworkRuleSetVirtualNetworkRule ] [-PublicNetworkAccess ] + [-RoutingPreferencePublishInternetEndpoint] [-RoutingPreferencePublishMicrosoftEndpoint] + [-RoutingPreferenceRoutingChoice ] [-SasPolicySasExpirationPeriod ] [-Tag ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Asynchronously creates a new storage account with the specified parameters. +If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. +If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccessTier +Required for storage accounts where kind = BlobStorage. +The access tier is used for billing. +The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyAccountType +Specifies the Active Directory account type for Azure Storage. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyAzureStorageSid +Specifies the security identifier (SID) for Azure Storage. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyDomainGuid +Specifies the domain GUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyDomainName +Specifies the primary domain that the AD DNS server is authoritative for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyDomainSid +Specifies the security identifier (SID). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyForestName +Specifies the Active Directory forest to get. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyNetBiosDomainName +Specifies the NetBIOS domain name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertySamAccountName +Specifies the Active Directory SAMAccountName for Azure Storage. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowBlobPublicAccess +Allow or disallow public access to all blobs or containers in the storage account. +The default interpretation is true for this property. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowCrossTenantReplication +Allow or disallow cross AAD tenant object replication. +The default interpretation is true for this property. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowedCopyScope +Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowSharedKeyAccess +Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. +If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). +The default value is null, which is equivalent to true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureFileIdentityBasedAuthenticationDefaultSharePermission +Default share permission for users using Kerberos authentication if RBAC role is not assigned. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureFileIdentityBasedAuthenticationDirectoryServiceOption +Indicates the directory service used. +Note that this enum may be extended in the future. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CustomDomainName +Gets or sets the custom domain name assigned to the storage account. +Name is the CNAME source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CustomDomainUseSubDomainName +Indicates whether indirect CName validation is enabled. +Default value is false. +This should only be set on updates. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultToOAuthAuthentication +A boolean flag which indicates whether the default authentication is OAuth or not. +The default interpretation is false for this property. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DnsEndpointType +Allows you to specify the type of endpoint. +Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableHttpsTrafficOnly +Allows https traffic only to storage service if sets to true. +The default value is true since API version 2019-04-01. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableNfsV3 +NFS 3.0 protocol support enabled if set to true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Encryption +Encryption settings to be used for server-side encryption for the storage account. +To construct, see NOTES section for ENCRYPTION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedLocationName +The name of the extended location. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ExtendedLocationType +The type of the extended location. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +The identity type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. +The key is the ARM resource identifier of the identity. +Only 1 User Assigned identity is permitted here. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPolicyAllowProtectedAppendWrite +This property can only be changed for disabled and unlocked time-based retention policies. +When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. +Only new blocks can be added and any existing blocks cannot be modified or deleted. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay +The immutability period for the blobs in the container since the policy creation, in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPolicyState +The ImmutabilityPolicy state defines the mode of the policy. +Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. +A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. +Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutableStorageWithVersioningEnabled +A boolean flag which enables account-level immutability. +All the containers under such an account have object-level immutability enabled by default. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IsHnsEnabled +Account HierarchicalNamespace enabled if sets to true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IsLocalUserEnabled +Enables local users feature, if set to true + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IsSftpEnabled +Enables Secure File Transfer Protocol, if set to true + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyPolicyKeyExpirationPeriodInDay +The key expiration period in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +Required. +Indicates the type of storage account. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LargeFileSharesState +Allow large file shares if sets to Enabled. +It cannot be disabled once it is enabled. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Location +Required. +Gets or sets the location of the resource. +This will be one of the supported and registered Azure Geo Regions (e.g. +West US, East US, Southeast Asia, etc.). +The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MinimumTlsVersion +Set the minimum TLS version to be permitted on requests to storage. +The default interpretation is TLS 1.0 for this property. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetBypass +Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. +Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetDefaultAction +Specifies the default action of allow or deny when no other rules match. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetIPRule +Sets the IP ACL rules +To construct, see NOTES section for NETWORKRULESETIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetResourceAccessRule +Sets the resource access rules +To construct, see NOTES section for NETWORKRULESETRESOURCEACCESSRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetVirtualNetworkRule +Sets the virtual network rules +To construct, see NOTES section for NETWORKRULESETVIRTUALNETWORKRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +Allow or disallow public network access to Storage Account. +Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoutingPreferencePublishInternetEndpoint +A boolean flag which indicates whether internet routing storage endpoints are to be published + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoutingPreferencePublishMicrosoftEndpoint +A boolean flag which indicates whether microsoft routing storage endpoints are to be published + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoutingPreferenceRoutingChoice +Routing Choice defines the kind of network routing opted by the user. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SasPolicySasExpirationPeriod +The SAS expiration period, DD.HH:MM:SS. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The SKU name. +Required for account creation; optional for update. +Note that in older versions, SKU name was called accountType. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Gets or sets a list of key value pairs that describe the resource. +These tags can be used for viewing and grouping this resource (across resource groups). +A maximum of 15 tags can be provided for a resource. +Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`ENCRYPTION `: Encryption settings to be used for server-side encryption for the storage account. + - `[BlobEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[BlobKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + - `[FileEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[FileKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + - `[IdentityEncryptionFederatedIdentityClientId ]`: ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. + - `[IdentityEncryptionUserAssignedIdentity ]`: Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + - `[KeySource ]`: The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + - `[KeyVaultPropertyKeyName ]`: The name of KeyVault key. + - `[KeyVaultPropertyKeyVaultUri ]`: The Uri of KeyVault. + - `[KeyVaultPropertyKeyVersion ]`: The version of KeyVault key. + - `[QueueEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[QueueKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + - `[RequireInfrastructureEncryption ]`: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + - `[TableEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[TableKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + +`NETWORKRULESETIPRULE `: Sets the IP ACL rules + - `IPAddressOrRange `: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + - `[Action ]`: The action of IP ACL rule. + +`NETWORKRULESETRESOURCEACCESSRULE `: Sets the resource access rules + - `[ResourceId ]`: Resource Id + - `[TenantId ]`: Tenant Id + +`NETWORKRULESETVIRTUALNETWORKRULE `: Sets the virtual network rules + - `VirtualNetworkResourceId `: Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + - `[Action ]`: The action of virtual network rule. + - `[State ]`: Gets the state of virtual network rule. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageAccountKey.md b/swaggerci/storage/docs/New-AzStorageAccountKey.md new file mode 100644 index 000000000000..10771328d822 --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageAccountKey.md @@ -0,0 +1,259 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageaccountkey +schema: 2.0.0 +--- + +# New-AzStorageAccountKey + +## SYNOPSIS +Regenerates one of the access keys or Kerberos keys for the specified storage account. + +## SYNTAX + +### RegenerateExpanded (Default) +``` +New-AzStorageAccountKey -AccountName -ResourceGroupName -KeyName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Regenerate +``` +New-AzStorageAccountKey -AccountName -ResourceGroupName + -RegenerateKey [-SubscriptionId ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentity +``` +New-AzStorageAccountKey -InputObject + -RegenerateKey [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### RegenerateViaIdentityExpanded +``` +New-AzStorageAccountKey -InputObject -KeyName [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Regenerates one of the access keys or Kerberos keys for the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: RegenerateViaIdentity, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -KeyName +The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + +```yaml +Type: System.String +Parameter Sets: RegenerateExpanded, RegenerateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RegenerateKey +The parameters used to regenerate the storage account key. +To construct, see NOTES section for REGENERATEKEY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters +Parameter Sets: Regenerate, RegenerateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Regenerate, RegenerateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`REGENERATEKEY `: The parameters used to regenerate the storage account key. + - `KeyName `: The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageBlobContainer.md b/swaggerci/storage/docs/New-AzStorageBlobContainer.md new file mode 100644 index 000000000000..420abe343d97 --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageBlobContainer.md @@ -0,0 +1,214 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobcontainer +schema: 2.0.0 +--- + +# New-AzStorageBlobContainer + +## SYNOPSIS +Creates a new container under the specified account as described by request body. +The container resource includes metadata and properties for that container. +It does not include a list of the blobs contained by the container. + +## SYNTAX + +``` +New-AzStorageBlobContainer -AccountName -ContainerName -ResourceGroupName + [-SubscriptionId ] [-ContainerProperty ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new container under the specified account as described by request body. +The container resource includes metadata and properties for that container. +It does not include a list of the blobs contained by the container. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerProperty +Properties of the blob container. +To construct, see NOTES section for CONTAINERPROPERTY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`CONTAINERPROPERTY `: Properties of the blob container. + - `[AllowProtectedAppendWrite ]`: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + - `[AllowProtectedAppendWritesAll ]`: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + - `[DefaultEncryptionScope ]`: Default the container to use specified encryption scope for all writes. + - `[DenyEncryptionScopeOverride ]`: Block override of encryption scope from the container default. + - `[EnableNfsV3AllSquash ]`: Enable NFSv3 all squash on blob container. + - `[EnableNfsV3RootSquash ]`: Enable NFSv3 root squash on blob container. + - `[ImmutabilityPeriodSinceCreationInDay ]`: The immutability period for the blobs in the container since the policy creation, in days. + - `[ImmutableStorageWithVersioningEnabled ]`: This is an immutable property, when set to true it enables object level immutability at the container level. + - `[LegalHoldTag ]`: The list of LegalHold tags of a blob container. + - `[Metadata ]`: A name-value pair to associate with the container as metadata. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll ]`: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + - `[PublicAccess ]`: Specifies whether data in the container may be accessed publicly and the level of access. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/docs/New-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..3daf22116869 --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,246 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobcontainerimmutabilitypolicy +schema: 2.0.0 +--- + +# New-AzStorageBlobContainerImmutabilityPolicy + +## SYNOPSIS +Creates or updates an unlocked immutability policy. +ETag in If-Match is honored if given but not required for this operation. + +## SYNTAX + +``` +New-AzStorageBlobContainerImmutabilityPolicy -AccountName -ContainerName + -ResourceGroupName [-SubscriptionId ] [-IfMatch ] [-AllowProtectedAppendWrite] + [-AllowProtectedAppendWritesAll] [-ImmutabilityPeriodSinceCreationInDay ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates or updates an unlocked immutability policy. +ETag in If-Match is honored if given but not required for this operation. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowProtectedAppendWrite +This property can only be changed for unlocked time-based retention policies. +When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. +Only new blocks can be added and any existing blocks cannot be modified or deleted. +This property cannot be changed with ExtendImmutabilityPolicy API. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowProtectedAppendWritesAll +This property can only be changed for unlocked time-based retention policies. +When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. +Only new blocks can be added and any existing blocks cannot be modified or deleted. +This property cannot be changed with ExtendImmutabilityPolicy API. +The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The entity state (ETag) version of the immutability policy to update. +A value of "*" can be used to apply the operation only if the immutability policy already exists. +If omitted, this operation will always be applied. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPeriodSinceCreationInDay +The immutability period for the blobs in the container since the policy creation, in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageBlobInventoryPolicy.md b/swaggerci/storage/docs/New-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..318904ea666a --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,209 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobinventorypolicy +schema: 2.0.0 +--- + +# New-AzStorageBlobInventoryPolicy + +## SYNOPSIS +Sets the blob inventory policy to the specified storage account. + +## SYNTAX + +``` +New-AzStorageBlobInventoryPolicy -AccountName -ResourceGroupName [-SubscriptionId ] + [-PolicyEnabled] [-PolicyRule ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Sets the blob inventory policy to the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PolicyEnabled +Policy is enabled if set to true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PolicyRule +The storage account blob inventory policy rules. +The rule is applied when it is enabled. +To construct, see NOTES section for POLICYRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`POLICYRULE `: The storage account blob inventory policy rules. The rule is applied when it is enabled. + - `DefinitionFormat `: This is a required field, it specifies the format for the inventory files. + - `DefinitionObjectType `: This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + - `DefinitionSchedule `: This is a required field. This field is used to schedule an inventory formation. + - `DefinitionSchemaField `: This is a required field. This field specifies the fields and properties of the object to be included in the inventory. The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts. + - `Destination `: Container name where blob inventory files are stored. Must be pre-created. + - `Enabled `: Rule is enabled when set to true. + - `Name `: A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + - `[FilterBlobType ]`: An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + - `[FilterExcludePrefix ]`: An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + - `[FilterIncludeBlobVersion ]`: Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, else they must be excluded. + - `[FilterIncludeDeleted ]`: For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be excluded. + - `[FilterIncludeSnapshot ]`: Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded. + - `[FilterPrefixMatch ]`: An array of strings with maximum 10 blob prefixes to be included in the inventory. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageFileShare.md b/swaggerci/storage/docs/New-AzStorageFileShare.md new file mode 100644 index 000000000000..f113e96c988e --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageFileShare.md @@ -0,0 +1,306 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragefileshare +schema: 2.0.0 +--- + +# New-AzStorageFileShare + +## SYNOPSIS +Creates a new share under the specified account as described by request body. +The share resource includes metadata and properties for that share. +It does not include a list of the files contained by the share. + +## SYNTAX + +``` +New-AzStorageFileShare -AccountName -ResourceGroupName -ShareName + [-SubscriptionId ] [-Expand ] [-FileSharePropertyAccessTier ] + [-FileSharePropertyEnabledProtocol ] [-FileSharePropertyMetadata ] + [-FileSharePropertyRootSquash ] [-FileSharePropertyShareQuota ] + [-FileSharePropertySignedIdentifier ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Creates a new share under the specified account as described by request body. +The share resource includes metadata and properties for that share. +It does not include a list of the files contained by the share. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Expand +Optional, used to expand the properties within share's properties. +Valid values are: snapshots. +Should be passed as a string with delimiter ',' + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyAccessTier +Access tier for specific share. +GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. +FileStorage account can choose Premium. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyEnabledProtocol +The authentication protocol that is used for the file share. +Can only be specified when creating a share. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyMetadata +A name-value pair to associate with the share as metadata. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyRootSquash +The property is for NFS share only. +The default is NoRootSquash. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyShareQuota +The maximum size of the share, in gigabytes. +Must be greater than 0, and less than or equal to 5TB (5120). +For Large File Shares, the maximum size is 102400. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertySignedIdentifier +List of stored access policies specified on the share. +To construct, see NOTES section for FILESHAREPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The name of the file share within the specified storage account. +File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`FILESHAREPROPERTYSIGNEDIDENTIFIER `: List of stored access policies specified on the share. + - `[AccessPolicyExpiryTime ]`: Expiry time of the access policy + - `[AccessPolicyPermission ]`: List of abbreviated permissions. + - `[AccessPolicyStartTime ]`: Start time of the access policy + - `[Id ]`: An unique identifier of the stored access policy. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageLocalUser.md b/swaggerci/storage/docs/New-AzStorageLocalUser.md new file mode 100644 index 000000000000..c0cc49d2d761 --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageLocalUser.md @@ -0,0 +1,284 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragelocaluser +schema: 2.0.0 +--- + +# New-AzStorageLocalUser + +## SYNOPSIS +Create or update the properties of a local user associated with the storage account + +## SYNTAX + +``` +New-AzStorageLocalUser -AccountName -ResourceGroupName -Username + [-SubscriptionId ] [-HasSharedKey] [-HasSshKey] [-HasSshPassword] [-HomeDirectory ] + [-PermissionScope ] [-SshAuthorizedKey ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or update the properties of a local user associated with the storage account + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HasSharedKey +Indicates whether shared key exists. +Set it to false to remove existing shared key. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HasSshKey +Indicates whether ssh key exists. +Set it to false to remove existing SSH key. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HasSshPassword +Indicates whether ssh password exists. +Set it to false to remove existing SSH password. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -HomeDirectory +Optional, local user home directory. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PermissionScope +The permission scopes of the local user. +To construct, see NOTES section for PERMISSIONSCOPE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SshAuthorizedKey +Optional, local user ssh authorized keys for SFTP. +To construct, see NOTES section for SSHAUTHORIZEDKEY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +The name of local user. +The username must contain lowercase letters and numbers only. +It must be unique only within the storage account. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`PERMISSIONSCOPE `: The permission scopes of the local user. + - `Permission `: The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c). + - `ResourceName `: The name of resource, normally the container name or the file share name, used by the local user. + - `Service `: The service used by the local user, e.g. blob, file. + +`SSHAUTHORIZEDKEY `: Optional, local user ssh authorized keys for SFTP. + - `[Description ]`: Optional. It is used to store the function/usage of the key + - `[Key ]`: Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageLocalUserPassword.md b/swaggerci/storage/docs/New-AzStorageLocalUserPassword.md new file mode 100644 index 000000000000..9f660347f574 --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageLocalUserPassword.md @@ -0,0 +1,226 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragelocaluserpassword +schema: 2.0.0 +--- + +# New-AzStorageLocalUserPassword + +## SYNOPSIS +Regenerate the local user SSH password. + +## SYNTAX + +### Regenerate (Default) +``` +New-AzStorageLocalUserPassword -AccountName -ResourceGroupName -Username + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### RegenerateViaIdentity +``` +New-AzStorageLocalUserPassword -InputObject [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Regenerate the local user SSH password. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Regenerate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: RegenerateViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Regenerate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Regenerate +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +The name of local user. +The username must contain lowercase letters and numbers only. +It must be unique only within the storage account. + +```yaml +Type: System.String +Parameter Sets: Regenerate +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.String + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageManagementPolicy.md b/swaggerci/storage/docs/New-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..7e542ca9c583 --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageManagementPolicy.md @@ -0,0 +1,215 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragemanagementpolicy +schema: 2.0.0 +--- + +# New-AzStorageManagementPolicy + +## SYNOPSIS +Sets the managementpolicy to the specified storage account. + +## SYNTAX + +``` +New-AzStorageManagementPolicy -AccountName -ResourceGroupName [-SubscriptionId ] + [-PolicyRule ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Sets the managementpolicy to the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PolicyRule +The Storage Account ManagementPolicies Rules. +See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. +To construct, see NOTES section for POLICYRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`POLICYRULE `: The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + - `DefinitionAction `: An object that defines the action set. + - `[BaseBlobDeleteDaysAfterCreationGreaterThan ]`: Value indicating the age in days after blob creation. + - `[BaseBlobDeleteDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + - `[BaseBlobEnableAutoTierToHotFromCool ]`: This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + - `[BaseBlobTierToArchiveDaysAfterCreationGreaterThan ]`: Value indicating the age in days after blob creation. + - `[BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + - `[BaseBlobTierToCoolDaysAfterCreationGreaterThan ]`: Value indicating the age in days after blob creation. + - `[BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + - `[DeleteDaysAfterLastAccessTimeGreaterThan ]`: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + - `[DeleteDaysAfterModificationGreaterThan ]`: Value indicating the age in days after last modification + - `[SnapshotDeleteDaysAfterCreationGreaterThan ]`: Value indicating the age in days after creation + - `[SnapshotDeleteDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + - `[SnapshotTierToArchiveDaysAfterCreationGreaterThan ]`: Value indicating the age in days after creation + - `[SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + - `[SnapshotTierToCoolDaysAfterCreationGreaterThan ]`: Value indicating the age in days after creation + - `[SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + - `[TierToArchiveDaysAfterLastAccessTimeGreaterThan ]`: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + - `[TierToArchiveDaysAfterModificationGreaterThan ]`: Value indicating the age in days after last modification + - `[TierToCoolDaysAfterLastAccessTimeGreaterThan ]`: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + - `[TierToCoolDaysAfterModificationGreaterThan ]`: Value indicating the age in days after last modification + - `[VersionDeleteDaysAfterCreationGreaterThan ]`: Value indicating the age in days after creation + - `[VersionDeleteDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + - `[VersionTierToArchiveDaysAfterCreationGreaterThan ]`: Value indicating the age in days after creation + - `[VersionTierToArchiveDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + - `[VersionTierToCoolDaysAfterCreationGreaterThan ]`: Value indicating the age in days after creation + - `[VersionTierToCoolDaysAfterLastTierChangeGreaterThan ]`: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + - `Name `: A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + - `[Enabled ]`: Rule is enabled if set to true. + - `[FilterBlobIndexMatch ]`: An array of blob index tag based filters, there can be at most 10 tag filters + - `Name `: This is the filter tag name, it can have 1 - 128 characters + - `Op `: This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported + - `Value `: This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + - `[FilterBlobType ]`: An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are supported for appendBlob. + - `[FilterPrefixMatch ]`: An array of strings for prefixes to be match. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageObjectReplicationPolicy.md b/swaggerci/storage/docs/New-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..bfc344a556b1 --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,237 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageobjectreplicationpolicy +schema: 2.0.0 +--- + +# New-AzStorageObjectReplicationPolicy + +## SYNOPSIS +Create or update the object replication policy of the storage account. + +## SYNTAX + +``` +New-AzStorageObjectReplicationPolicy -AccountName -Id -ResourceGroupName + [-SubscriptionId ] [-DestinationAccount ] [-Rule ] + [-SourceAccount ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Create or update the object replication policy of the storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DestinationAccount +Required. +Destination account name. +It should be full resource id if allowCrossTenantReplication set to false. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +For the destination account, provide the value 'default'. +Configure the policy on the destination account first. +For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. +The policy is downloaded as a JSON file. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: ObjectReplicationPolicyId + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Rule +The storage account object replication rules. +To construct, see NOTES section for RULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SourceAccount +Required. +Source account name. +It should be full resource id if allowCrossTenantReplication set to false. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`RULE `: The storage account object replication rules. + - `DestinationContainer `: Required. Destination container name. + - `SourceContainer `: Required. Source container name. + - `[FilterMinCreationTime ]`: Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z + - `[FilterPrefixMatch ]`: Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + - `[RuleId ]`: Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageQueue.md b/swaggerci/storage/docs/New-AzStorageQueue.md new file mode 100644 index 000000000000..a085c907372d --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageQueue.md @@ -0,0 +1,186 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragequeue +schema: 2.0.0 +--- + +# New-AzStorageQueue + +## SYNOPSIS +Creates a new queue with the specified queue name, under the specified account. + +## SYNTAX + +``` +New-AzStorageQueue -AccountName -Name -ResourceGroupName [-SubscriptionId ] + [-QueuePropertyMetadata ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new queue with the specified queue name, under the specified account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: QueueName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueuePropertyMetadata +A name-value pair that represents queue metadata. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + +## NOTES + +ALIASES + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/New-AzStorageTable.md b/swaggerci/storage/docs/New-AzStorageTable.md new file mode 100644 index 000000000000..34c6f28943dd --- /dev/null +++ b/swaggerci/storage/docs/New-AzStorageTable.md @@ -0,0 +1,199 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragetable +schema: 2.0.0 +--- + +# New-AzStorageTable + +## SYNOPSIS +Creates a new table with the specified table name, under the specified account. + +## SYNTAX + +``` +New-AzStorageTable -AccountName -Name -ResourceGroupName [-SubscriptionId ] + [-TablePropertySignedIdentifier ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Creates a new table with the specified table name, under the specified account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: TableName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TablePropertySignedIdentifier +List of stored access policies specified on the table. +To construct, see NOTES section for TABLEPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`TABLEPROPERTYSIGNEDIDENTIFIER `: List of stored access policies specified on the table. + - `Id `: unique-64-character-value of the stored access policy. + - `[AccessPolicyExpiryTime ]`: Expiry time of the access policy + - `[AccessPolicyPermission ]`: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + - `[AccessPolicyStartTime ]`: Start time of the access policy + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/README.md b/swaggerci/storage/docs/README.md new file mode 100644 index 000000000000..e1a362c30814 --- /dev/null +++ b/swaggerci/storage/docs/README.md @@ -0,0 +1,11 @@ +# Docs +This directory contains the documentation of the cmdlets for the `Az.Storage` module. To run documentation generation, use the `generate-help.ps1` script at the root module folder. Files in this folder will *always be overridden on regeneration*. To update documentation examples, please use the `../examples` folder. + +## Info +- Modifiable: no +- Generated: all +- Committed: yes +- Packaged: yes + +## Details +The process of documentation generation loads `Az.Storage` and analyzes the exported cmdlets from the module. It recognizes the [help comments](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_comment_based_help) that are generated into the scripts in the `../exports` folder. Additionally, when writing custom cmdlets in the `../custom` folder, you can use the help comments syntax, which decorate the exported scripts at build-time. The documentation examples are taken from the `../examples` folder. \ No newline at end of file diff --git a/swaggerci/storage/docs/Remove-AzStorageAccount.md b/swaggerci/storage/docs/Remove-AzStorageAccount.md new file mode 100644 index 000000000000..8606bec483ee --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageAccount.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageaccount +schema: 2.0.0 +--- + +# Remove-AzStorageAccount + +## SYNOPSIS +Deletes a storage account in Microsoft Azure. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageAccount -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageAccount -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Deletes a storage account in Microsoft Azure. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageBlobContainer.md b/swaggerci/storage/docs/Remove-AzStorageBlobContainer.md new file mode 100644 index 000000000000..e1d965875aa6 --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageBlobContainer.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobcontainer +schema: 2.0.0 +--- + +# Remove-AzStorageBlobContainer + +## SYNOPSIS +Deletes specified container under its account. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageBlobContainer -AccountName -ContainerName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageBlobContainer -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes specified container under its account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/docs/Remove-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..56755c0a4933 --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,250 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobcontainerimmutabilitypolicy +schema: 2.0.0 +--- + +# Remove-AzStorageBlobContainerImmutabilityPolicy + +## SYNOPSIS +Aborts an unlocked immutability policy. +The response of delete has immutabilityPeriodSinceCreationInDays set to 0. +ETag in If-Match is required for this operation. +Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageBlobContainerImmutabilityPolicy -AccountName -ContainerName + -ResourceGroupName -IfMatch [-SubscriptionId ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageBlobContainerImmutabilityPolicy -InputObject -IfMatch + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Aborts an unlocked immutability policy. +The response of delete has immutabilityPeriodSinceCreationInDays set to 0. +ETag in If-Match is required for this operation. +Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IfMatch +The entity state (ETag) version of the immutability policy to update. +A value of "*" can be used to apply the operation only if the immutability policy already exists. +If omitted, this operation will always be applied. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageBlobInventoryPolicy.md b/swaggerci/storage/docs/Remove-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..97e8fd9d5ffd --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobinventorypolicy +schema: 2.0.0 +--- + +# Remove-AzStorageBlobInventoryPolicy + +## SYNOPSIS +Deletes the blob inventory policy associated with the specified storage account. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageBlobInventoryPolicy -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageBlobInventoryPolicy -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the blob inventory policy associated with the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageFileShare.md b/swaggerci/storage/docs/Remove-AzStorageFileShare.md new file mode 100644 index 000000000000..c202ae6fe638 --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageFileShare.md @@ -0,0 +1,279 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragefileshare +schema: 2.0.0 +--- + +# Remove-AzStorageFileShare + +## SYNOPSIS +Deletes specified share under its account. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageFileShare -AccountName -ResourceGroupName -ShareName + [-SubscriptionId ] [-Include ] [-XmsSnapshot ] [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageFileShare -InputObject [-Include ] [-XmsSnapshot ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes specified share under its account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Include +Optional. +Valid values are: snapshots, leased-snapshots, none. +The default value is snapshots. +For 'snapshots', the file share is deleted including all of its file share snapshots. +If the file share contains leased-snapshots, the deletion fails. +For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). +For 'none', the file share is deleted if it has no share snapshots. +If the file share contains any snapshots (leased or unleased), the deletion fails. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The name of the file share within the specified storage account. +File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -XmsSnapshot +Optional, used to delete a snapshot. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageLocalUser.md b/swaggerci/storage/docs/Remove-AzStorageLocalUser.md new file mode 100644 index 000000000000..e99eff01de68 --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageLocalUser.md @@ -0,0 +1,241 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragelocaluser +schema: 2.0.0 +--- + +# Remove-AzStorageLocalUser + +## SYNOPSIS +Deletes the local user associated with the specified storage account. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageLocalUser -AccountName -ResourceGroupName -Username + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageLocalUser -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the local user associated with the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Username +The name of local user. +The username must contain lowercase letters and numbers only. +It must be unique only within the storage account. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageManagementPolicy.md b/swaggerci/storage/docs/Remove-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..a3736dee2d2e --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageManagementPolicy.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragemanagementpolicy +schema: 2.0.0 +--- + +# Remove-AzStorageManagementPolicy + +## SYNOPSIS +Deletes the managementpolicy associated with the specified storage account. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageManagementPolicy -AccountName -ResourceGroupName [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageManagementPolicy -InputObject [-DefaultProfile ] [-PassThru] + [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the managementpolicy associated with the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageObjectReplicationPolicy.md b/swaggerci/storage/docs/Remove-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..d31c0731b8ca --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,242 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageobjectreplicationpolicy +schema: 2.0.0 +--- + +# Remove-AzStorageObjectReplicationPolicy + +## SYNOPSIS +Deletes the object replication policy associated with the specified storage account. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageObjectReplicationPolicy -AccountName -Id -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageObjectReplicationPolicy -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the object replication policy associated with the specified storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Id +For the destination account, provide the value 'default'. +Configure the policy on the destination account first. +For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. +The policy is downloaded as a JSON file. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: ObjectReplicationPolicyId + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStoragePrivateEndpointConnection.md b/swaggerci/storage/docs/Remove-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..bd0c3e6b9def --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStoragePrivateEndpointConnection.md @@ -0,0 +1,239 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageprivateendpointconnection +schema: 2.0.0 +--- + +# Remove-AzStoragePrivateEndpointConnection + +## SYNOPSIS +Deletes the specified private endpoint connection associated with the storage account. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStoragePrivateEndpointConnection -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStoragePrivateEndpointConnection -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the specified private endpoint connection associated with the storage account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The name of the private endpoint connection associated with the Azure resource + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: PrivateEndpointConnectionName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageQueue.md b/swaggerci/storage/docs/Remove-AzStorageQueue.md new file mode 100644 index 000000000000..451e6639d930 --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageQueue.md @@ -0,0 +1,239 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragequeue +schema: 2.0.0 +--- + +# Remove-AzStorageQueue + +## SYNOPSIS +Deletes the queue with the specified queue name, under the specified account if it exists. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageQueue -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageQueue -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the queue with the specified queue name, under the specified account if it exists. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: QueueName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Remove-AzStorageTable.md b/swaggerci/storage/docs/Remove-AzStorageTable.md new file mode 100644 index 000000000000..0e9052414fcc --- /dev/null +++ b/swaggerci/storage/docs/Remove-AzStorageTable.md @@ -0,0 +1,239 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragetable +schema: 2.0.0 +--- + +# Remove-AzStorageTable + +## SYNOPSIS +Deletes the table with the specified table name, under the specified account if it exists. + +## SYNTAX + +### Delete (Default) +``` +Remove-AzStorageTable -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### DeleteViaIdentity +``` +Remove-AzStorageTable -InputObject [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +## DESCRIPTION +Deletes the table with the specified table name, under the specified account if it exists. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: DeleteViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: TableName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Delete +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Restore-AzStorageAccountBlobRange.md b/swaggerci/storage/docs/Restore-AzStorageAccountBlobRange.md new file mode 100644 index 000000000000..b0967d067f56 --- /dev/null +++ b/swaggerci/storage/docs/Restore-AzStorageAccountBlobRange.md @@ -0,0 +1,313 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/restore-azstorageaccountblobrange +schema: 2.0.0 +--- + +# Restore-AzStorageAccountBlobRange + +## SYNOPSIS +Restore blobs in the specified blob ranges + +## SYNTAX + +### RestoreViaIdentity (Default) +``` +Restore-AzStorageAccountBlobRange -InputObject -Parameter + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### Restore +``` +Restore-AzStorageAccountBlobRange -AccountName -ResourceGroupName + -Parameter [-SubscriptionId ] [-DefaultProfile ] [-AsJob] + [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### RestoreExpanded +``` +Restore-AzStorageAccountBlobRange -AccountName -ResourceGroupName + -BlobRange -TimeToRestore [-SubscriptionId ] + [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] [] +``` + +### RestoreViaIdentityExpanded +``` +Restore-AzStorageAccountBlobRange -InputObject -BlobRange + -TimeToRestore [-DefaultProfile ] [-AsJob] [-NoWait] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Restore blobs in the specified blob ranges + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Restore, RestoreExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AsJob +Run the command as a job + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -BlobRange +Blob ranges to restore. +To construct, see NOTES section for BLOBRANGE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] +Parameter Sets: RestoreExpanded, RestoreViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: RestoreViaIdentity, RestoreViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -NoWait +Run the command asynchronously + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Parameter +Blob restore parameters +To construct, see NOTES section for PARAMETER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters +Parameter Sets: Restore, RestoreViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Restore, RestoreExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Restore, RestoreExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TimeToRestore +Restore blob to the specified time. + +```yaml +Type: System.DateTime +Parameter Sets: RestoreExpanded, RestoreViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`BLOBRANGE `: Blob ranges to restore. + - `EndRange `: Blob end range. This is exclusive. Empty means account end. + - `StartRange `: Blob start range. This is inclusive. Empty means account start. + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`PARAMETER `: Blob restore parameters + - `BlobRange `: Blob ranges to restore. + - `EndRange `: Blob end range. This is exclusive. Empty means account end. + - `StartRange `: Blob start range. This is inclusive. Empty means account start. + - `TimeToRestore `: Restore blob to the specified time. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Restore-AzStorageFileShare.md b/swaggerci/storage/docs/Restore-AzStorageFileShare.md new file mode 100644 index 000000000000..f77b841c23a9 --- /dev/null +++ b/swaggerci/storage/docs/Restore-AzStorageFileShare.md @@ -0,0 +1,310 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/restore-azstoragefileshare +schema: 2.0.0 +--- + +# Restore-AzStorageFileShare + +## SYNOPSIS +Restore a file share within a valid retention days if share soft delete is enabled + +## SYNTAX + +### RestoreExpanded (Default) +``` +Restore-AzStorageFileShare -AccountName -ResourceGroupName -ShareName + -DeletedShareName -DeletedShareVersion [-SubscriptionId ] + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### Restore +``` +Restore-AzStorageFileShare -AccountName -ResourceGroupName -ShareName + -DeletedShare [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] + [-WhatIf] [] +``` + +### RestoreViaIdentity +``` +Restore-AzStorageFileShare -InputObject -DeletedShare + [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RestoreViaIdentityExpanded +``` +Restore-AzStorageFileShare -InputObject -DeletedShareName + -DeletedShareVersion [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Restore a file share within a valid retention days if share soft delete is enabled + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Restore, RestoreExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeletedShare +The deleted share to be restored. +To construct, see NOTES section for DELETEDSHARE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare +Parameter Sets: Restore, RestoreViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DeletedShareName +Required. +Identify the name of the deleted share that will be restored. + +```yaml +Type: System.String +Parameter Sets: RestoreExpanded, RestoreViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DeletedShareVersion +Required. +Identify the version of the deleted share that will be restored. + +```yaml +Type: System.String +Parameter Sets: RestoreExpanded, RestoreViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: RestoreViaIdentity, RestoreViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Restore, RestoreExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The name of the file share within the specified storage account. +File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Restore, RestoreExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Restore, RestoreExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`DELETEDSHARE `: The deleted share to be restored. + - `Name `: Required. Identify the name of the deleted share that will be restored. + - `Version `: Required. Identify the version of the deleted share that will be restored. + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Revoke-AzStorageAccountUserDelegationKey.md b/swaggerci/storage/docs/Revoke-AzStorageAccountUserDelegationKey.md new file mode 100644 index 000000000000..6eb64c021eb3 --- /dev/null +++ b/swaggerci/storage/docs/Revoke-AzStorageAccountUserDelegationKey.md @@ -0,0 +1,224 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/revoke-azstorageaccountuserdelegationkey +schema: 2.0.0 +--- + +# Revoke-AzStorageAccountUserDelegationKey + +## SYNOPSIS +Revoke user delegation keys. + +## SYNTAX + +### Revoke (Default) +``` +Revoke-AzStorageAccountUserDelegationKey -AccountName -ResourceGroupName + [-SubscriptionId ] [-DefaultProfile ] [-PassThru] [-Confirm] [-WhatIf] [] +``` + +### RevokeViaIdentity +``` +Revoke-AzStorageAccountUserDelegationKey -InputObject [-DefaultProfile ] + [-PassThru] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Revoke user delegation keys. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Revoke +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: RevokeViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -PassThru +Returns true when the command succeeds + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Revoke +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Revoke +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### System.Boolean + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Test-AzStorageAccountNameAvailability.md b/swaggerci/storage/docs/Test-AzStorageAccountNameAvailability.md new file mode 100644 index 000000000000..0662116cf3b3 --- /dev/null +++ b/swaggerci/storage/docs/Test-AzStorageAccountNameAvailability.md @@ -0,0 +1,226 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/test-azstorageaccountnameavailability +schema: 2.0.0 +--- + +# Test-AzStorageAccountNameAvailability + +## SYNOPSIS +Checks that the storage account name is valid and is not already in use. + +## SYNTAX + +### CheckExpanded (Default) +``` +Test-AzStorageAccountNameAvailability -Name [-SubscriptionId ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### Check +``` +Test-AzStorageAccountNameAvailability -AccountName + [-SubscriptionId ] [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### CheckViaIdentity +``` +Test-AzStorageAccountNameAvailability -InputObject + -AccountName [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### CheckViaIdentityExpanded +``` +Test-AzStorageAccountNameAvailability -InputObject -Name + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Checks that the storage account name is valid and is not already in use. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The parameters used to check the availability of the storage account name. +To construct, see NOTES section for ACCOUNTNAME properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters +Parameter Sets: Check, CheckViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: CheckViaIdentity, CheckViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +The storage account name. + +```yaml +Type: System.String +Parameter Sets: CheckExpanded, CheckViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Check, CheckExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`ACCOUNTNAME `: The parameters used to check the availability of the storage account name. + - `Name `: The storage account name. + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Update-AzStorageAccount.md b/swaggerci/storage/docs/Update-AzStorageAccount.md new file mode 100644 index 000000000000..1519b3bbe75d --- /dev/null +++ b/swaggerci/storage/docs/Update-AzStorageAccount.md @@ -0,0 +1,1008 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageaccount +schema: 2.0.0 +--- + +# Update-AzStorageAccount + +## SYNOPSIS +The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +It can also be used to map the account to a custom domain. +Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. +In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. +The update of multiple properties is supported. +This call does not change the storage keys for the account. +If you want to change the storage account keys, use the regenerate keys operation. +The location and name of the storage account cannot be changed after creation. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageAccount -AccountName -ResourceGroupName [-SubscriptionId ] + [-AccessTier ] [-ActiveDirectoryPropertyAccountType ] + [-ActiveDirectoryPropertyAzureStorageSid ] [-ActiveDirectoryPropertyDomainGuid ] + [-ActiveDirectoryPropertyDomainName ] [-ActiveDirectoryPropertyDomainSid ] + [-ActiveDirectoryPropertyForestName ] [-ActiveDirectoryPropertyNetBiosDomainName ] + [-ActiveDirectoryPropertySamAccountName ] [-AllowBlobPublicAccess] [-AllowCrossTenantReplication] + [-AllowedCopyScope ] [-AllowSharedKeyAccess] + [-AzureFileIdentityBasedAuthenticationDefaultSharePermission ] + [-AzureFileIdentityBasedAuthenticationDirectoryServiceOption ] + [-CustomDomainName ] [-CustomDomainUseSubDomainName] [-DefaultToOAuthAuthentication] + [-DnsEndpointType ] [-EnableHttpsTrafficOnly] [-Encryption ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-ImmutabilityPolicyAllowProtectedAppendWrite] + [-ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ] + [-ImmutabilityPolicyState ] [-ImmutableStorageWithVersioningEnabled] + [-IsLocalUserEnabled] [-IsSftpEnabled] [-KeyPolicyKeyExpirationPeriodInDay ] [-Kind ] + [-LargeFileSharesState ] [-MinimumTlsVersion ] + [-NetworkRuleSetBypass ] [-NetworkRuleSetDefaultAction ] + [-NetworkRuleSetIPRule ] [-NetworkRuleSetResourceAccessRule ] + [-NetworkRuleSetVirtualNetworkRule ] [-PublicNetworkAccess ] + [-RoutingPreferencePublishInternetEndpoint] [-RoutingPreferencePublishMicrosoftEndpoint] + [-RoutingPreferenceRoutingChoice ] [-SasPolicySasExpirationPeriod ] + [-SkuName ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageAccount -InputObject [-AccessTier ] + [-ActiveDirectoryPropertyAccountType ] [-ActiveDirectoryPropertyAzureStorageSid ] + [-ActiveDirectoryPropertyDomainGuid ] [-ActiveDirectoryPropertyDomainName ] + [-ActiveDirectoryPropertyDomainSid ] [-ActiveDirectoryPropertyForestName ] + [-ActiveDirectoryPropertyNetBiosDomainName ] [-ActiveDirectoryPropertySamAccountName ] + [-AllowBlobPublicAccess] [-AllowCrossTenantReplication] [-AllowedCopyScope ] + [-AllowSharedKeyAccess] + [-AzureFileIdentityBasedAuthenticationDefaultSharePermission ] + [-AzureFileIdentityBasedAuthenticationDirectoryServiceOption ] + [-CustomDomainName ] [-CustomDomainUseSubDomainName] [-DefaultToOAuthAuthentication] + [-DnsEndpointType ] [-EnableHttpsTrafficOnly] [-Encryption ] + [-IdentityType ] [-IdentityUserAssignedIdentity ] + [-ImmutabilityPolicyAllowProtectedAppendWrite] + [-ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ] + [-ImmutabilityPolicyState ] [-ImmutableStorageWithVersioningEnabled] + [-IsLocalUserEnabled] [-IsSftpEnabled] [-KeyPolicyKeyExpirationPeriodInDay ] [-Kind ] + [-LargeFileSharesState ] [-MinimumTlsVersion ] + [-NetworkRuleSetBypass ] [-NetworkRuleSetDefaultAction ] + [-NetworkRuleSetIPRule ] [-NetworkRuleSetResourceAccessRule ] + [-NetworkRuleSetVirtualNetworkRule ] [-PublicNetworkAccess ] + [-RoutingPreferencePublishInternetEndpoint] [-RoutingPreferencePublishMicrosoftEndpoint] + [-RoutingPreferenceRoutingChoice ] [-SasPolicySasExpirationPeriod ] + [-SkuName ] [-Tag ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +It can also be used to map the account to a custom domain. +Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. +In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. +The update of multiple properties is supported. +This call does not change the storage keys for the account. +If you want to change the storage account keys, use the regenerate keys operation. +The location and name of the storage account cannot be changed after creation. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccessTier +Required for storage accounts where kind = BlobStorage. +The access tier is used for billing. +The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyAccountType +Specifies the Active Directory account type for Azure Storage. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyAzureStorageSid +Specifies the security identifier (SID) for Azure Storage. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyDomainGuid +Specifies the domain GUID. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyDomainName +Specifies the primary domain that the AD DNS server is authoritative for. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyDomainSid +Specifies the security identifier (SID). + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyForestName +Specifies the Active Directory forest to get. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertyNetBiosDomainName +Specifies the NetBIOS domain name. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ActiveDirectoryPropertySamAccountName +Specifies the Active Directory SAMAccountName for Azure Storage. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowBlobPublicAccess +Allow or disallow public access to all blobs or containers in the storage account. +The default interpretation is true for this property. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowCrossTenantReplication +Allow or disallow cross AAD tenant object replication. +The default interpretation is true for this property. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowedCopyScope +Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AllowSharedKeyAccess +Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. +If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). +The default value is null, which is equivalent to true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureFileIdentityBasedAuthenticationDefaultSharePermission +Default share permission for users using Kerberos authentication if RBAC role is not assigned. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -AzureFileIdentityBasedAuthenticationDirectoryServiceOption +Indicates the directory service used. +Note that this enum may be extended in the future. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CustomDomainName +Gets or sets the custom domain name assigned to the storage account. +Name is the CNAME source. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -CustomDomainUseSubDomainName +Indicates whether indirect CName validation is enabled. +Default value is false. +This should only be set on updates. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultToOAuthAuthentication +A boolean flag which indicates whether the default authentication is OAuth or not. +The default interpretation is false for this property. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DnsEndpointType +Allows you to specify the type of endpoint. +Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EnableHttpsTrafficOnly +Allows https traffic only to storage service if sets to true. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Encryption +Not applicable. +Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. +To construct, see NOTES section for ENCRYPTION properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityType +The identity type. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IdentityUserAssignedIdentity +Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. +The key is the ARM resource identifier of the identity. +Only 1 User Assigned identity is permitted here. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPolicyAllowProtectedAppendWrite +This property can only be changed for disabled and unlocked time-based retention policies. +When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. +Only new blocks can be added and any existing blocks cannot be modified or deleted. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay +The immutability period for the blobs in the container since the policy creation, in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutabilityPolicyState +The ImmutabilityPolicy state defines the mode of the policy. +Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. +A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. +Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ImmutableStorageWithVersioningEnabled +A boolean flag which enables account-level immutability. +All the containers under such an account have object-level immutability enabled by default. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -IsLocalUserEnabled +Enables local users feature, if set to true + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -IsSftpEnabled +Enables Secure File Transfer Protocol, if set to true + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -KeyPolicyKeyExpirationPeriodInDay +The key expiration period in days. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Kind +Optional. +Indicates the type of storage account. +Currently only StorageV2 value supported by server. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -LargeFileSharesState +Allow large file shares if sets to Enabled. +It cannot be disabled once it is enabled. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -MinimumTlsVersion +Set the minimum TLS version to be permitted on requests to storage. +The default interpretation is TLS 1.0 for this property. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetBypass +Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. +Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetDefaultAction +Specifies the default action of allow or deny when no other rules match. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetIPRule +Sets the IP ACL rules +To construct, see NOTES section for NETWORKRULESETIPRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetResourceAccessRule +Sets the resource access rules +To construct, see NOTES section for NETWORKRULESETRESOURCEACCESSRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -NetworkRuleSetVirtualNetworkRule +Sets the virtual network rules +To construct, see NOTES section for NETWORKRULESETVIRTUALNETWORKRULE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -PublicNetworkAccess +Allow or disallow public network access to Storage Account. +Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoutingPreferencePublishInternetEndpoint +A boolean flag which indicates whether internet routing storage endpoints are to be published + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoutingPreferencePublishMicrosoftEndpoint +A boolean flag which indicates whether microsoft routing storage endpoints are to be published + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -RoutingPreferenceRoutingChoice +Routing Choice defines the kind of network routing opted by the user. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SasPolicySasExpirationPeriod +The SAS expiration period, DD.HH:MM:SS. + +```yaml +Type: System.String +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SkuName +The SKU name. +Required for account creation; optional for update. +Note that in older versions, SKU name was called accountType. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Tag +Gets or sets a list of key value pairs that describe the resource. +These tags can be used in viewing and grouping this resource (across resource groups). +A maximum of 15 tags can be provided for a resource. +Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`ENCRYPTION `: Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + - `[BlobEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[BlobKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + - `[FileEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[FileKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + - `[IdentityEncryptionFederatedIdentityClientId ]`: ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. + - `[IdentityEncryptionUserAssignedIdentity ]`: Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + - `[KeySource ]`: The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + - `[KeyVaultPropertyKeyName ]`: The name of KeyVault key. + - `[KeyVaultPropertyKeyVaultUri ]`: The Uri of KeyVault. + - `[KeyVaultPropertyKeyVersion ]`: The version of KeyVault key. + - `[QueueEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[QueueKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + - `[RequireInfrastructureEncryption ]`: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + - `[TableEnabled ]`: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + - `[TableKeyType ]`: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`NETWORKRULESETIPRULE `: Sets the IP ACL rules + - `IPAddressOrRange `: Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + - `[Action ]`: The action of IP ACL rule. + +`NETWORKRULESETRESOURCEACCESSRULE `: Sets the resource access rules + - `[ResourceId ]`: Resource Id + - `[TenantId ]`: Tenant Id + +`NETWORKRULESETVIRTUALNETWORKRULE `: Sets the virtual network rules + - `VirtualNetworkResourceId `: Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + - `[Action ]`: The action of virtual network rule. + - `[State ]`: Gets the state of virtual network rule. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Update-AzStorageBlobContainer.md b/swaggerci/storage/docs/Update-AzStorageBlobContainer.md new file mode 100644 index 000000000000..9f7b5105c29b --- /dev/null +++ b/swaggerci/storage/docs/Update-AzStorageBlobContainer.md @@ -0,0 +1,262 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageblobcontainer +schema: 2.0.0 +--- + +# Update-AzStorageBlobContainer + +## SYNOPSIS +Updates container properties as specified in request body. +Properties not mentioned in the request will be unchanged. +Update fails if the specified container doesn't already exist. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageBlobContainer -AccountName -ContainerName -ResourceGroupName + [-SubscriptionId ] [-ContainerProperty ] [-DefaultProfile ] + [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageBlobContainer -InputObject [-ContainerProperty ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Updates container properties as specified in request body. +Properties not mentioned in the request will be unchanged. +Update fails if the specified container doesn't already exist. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerName +The name of the blob container within the specified storage account. +Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ContainerProperty +Properties of the blob container. +To construct, see NOTES section for CONTAINERPROPERTY properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`CONTAINERPROPERTY `: Properties of the blob container. + - `[AllowProtectedAppendWrite ]`: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + - `[AllowProtectedAppendWritesAll ]`: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + - `[DefaultEncryptionScope ]`: Default the container to use specified encryption scope for all writes. + - `[DenyEncryptionScopeOverride ]`: Block override of encryption scope from the container default. + - `[EnableNfsV3AllSquash ]`: Enable NFSv3 all squash on blob container. + - `[EnableNfsV3RootSquash ]`: Enable NFSv3 root squash on blob container. + - `[ImmutabilityPeriodSinceCreationInDay ]`: The immutability period for the blobs in the container since the policy creation, in days. + - `[ImmutableStorageWithVersioningEnabled ]`: This is an immutable property, when set to true it enables object level immutability at the container level. + - `[LegalHoldTag ]`: The list of LegalHold tags of a blob container. + - `[Metadata ]`: A name-value pair to associate with the container as metadata. + - `[(Any) ]`: This indicates any property can be added to this object. + - `[ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll ]`: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + - `[PublicAccess ]`: Specifies whether data in the container may be accessed publicly and the level of access. + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Update-AzStorageEncryptionScope.md b/swaggerci/storage/docs/Update-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..a77cb0abdda6 --- /dev/null +++ b/swaggerci/storage/docs/Update-AzStorageEncryptionScope.md @@ -0,0 +1,334 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageencryptionscope +schema: 2.0.0 +--- + +# Update-AzStorageEncryptionScope + +## SYNOPSIS +Update encryption scope properties as specified in the request body. +Update fails if the specified encryption scope does not already exist. + +## SYNTAX + +### PatchExpanded (Default) +``` +Update-AzStorageEncryptionScope -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-EncryptionScopePropertyRequireInfrastructureEncryption] + [-EncryptionScopePropertySource ] + [-EncryptionScopePropertyState ] [-KeyVaultPropertyKeyUri ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### Patch +``` +Update-AzStorageEncryptionScope -AccountName -Name -ResourceGroupName + -EncryptionScope [-SubscriptionId ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### PatchViaIdentity +``` +Update-AzStorageEncryptionScope -InputObject -EncryptionScope + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### PatchViaIdentityExpanded +``` +Update-AzStorageEncryptionScope -InputObject + [-EncryptionScopePropertyRequireInfrastructureEncryption] + [-EncryptionScopePropertySource ] + [-EncryptionScopePropertyState ] [-KeyVaultPropertyKeyUri ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Update encryption scope properties as specified in the request body. +Update fails if the specified encryption scope does not already exist. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionScope +The Encryption Scope resource. +To construct, see NOTES section for ENCRYPTIONSCOPE properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope +Parameter Sets: Patch, PatchViaIdentity +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -EncryptionScopePropertyRequireInfrastructureEncryption +A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionScopePropertySource +The provider for the encryption scope. +Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -EncryptionScopePropertyState +The state of the encryption scope. +Possible values (case-insensitive): Enabled, Disabled. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: PatchViaIdentity, PatchViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -KeyVaultPropertyKeyUri +The object identifier for a key vault key object. +When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + +```yaml +Type: System.String +Parameter Sets: PatchExpanded, PatchViaIdentityExpanded +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Name +The name of the encryption scope within the specified storage account. +Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: EncryptionScopeName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: Patch, PatchExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`ENCRYPTIONSCOPE `: The Encryption Scope resource. + - `[KeyVaultPropertyKeyUri ]`: The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + - `[PropertyRequireInfrastructureEncryption ]`: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + - `[PropertySource ]`: The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + - `[PropertyState ]`: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Update-AzStorageFileShare.md b/swaggerci/storage/docs/Update-AzStorageFileShare.md new file mode 100644 index 000000000000..069e189c3b30 --- /dev/null +++ b/swaggerci/storage/docs/Update-AzStorageFileShare.md @@ -0,0 +1,340 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragefileshare +schema: 2.0.0 +--- + +# Update-AzStorageFileShare + +## SYNOPSIS +Updates share properties as specified in request body. +Properties not mentioned in the request will not be changed. +Update fails if the specified share does not already exist. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageFileShare -AccountName -ResourceGroupName -ShareName + [-SubscriptionId ] [-FileSharePropertyAccessTier ] + [-FileSharePropertyEnabledProtocol ] [-FileSharePropertyMetadata ] + [-FileSharePropertyRootSquash ] [-FileSharePropertyShareQuota ] + [-FileSharePropertySignedIdentifier ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageFileShare -InputObject [-FileSharePropertyAccessTier ] + [-FileSharePropertyEnabledProtocol ] [-FileSharePropertyMetadata ] + [-FileSharePropertyRootSquash ] [-FileSharePropertyShareQuota ] + [-FileSharePropertySignedIdentifier ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Updates share properties as specified in request body. +Properties not mentioned in the request will not be changed. +Update fails if the specified share does not already exist. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyAccessTier +Access tier for specific share. +GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. +FileStorage account can choose Premium. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyEnabledProtocol +The authentication protocol that is used for the file share. +Can only be specified when creating a share. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyMetadata +A name-value pair to associate with the share as metadata. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyRootSquash +The property is for NFS share only. +The default is NoRootSquash. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertyShareQuota +The maximum size of the share, in gigabytes. +Must be greater than 0, and less than or equal to 5TB (5120). +For Large File Shares, the maximum size is 102400. + +```yaml +Type: System.Int32 +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -FileSharePropertySignedIdentifier +List of stored access policies specified on the share. +To construct, see NOTES section for FILESHAREPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ShareName +The name of the file share within the specified storage account. +File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. +Every dash (-) character must be immediately preceded and followed by a letter or number. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`FILESHAREPROPERTYSIGNEDIDENTIFIER `: List of stored access policies specified on the share. + - `[AccessPolicyExpiryTime ]`: Expiry time of the access policy + - `[AccessPolicyPermission ]`: List of abbreviated permissions. + - `[AccessPolicyStartTime ]`: Start time of the access policy + - `[Id ]`: An unique identifier of the stored access policy. + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Update-AzStorageQueue.md b/swaggerci/storage/docs/Update-AzStorageQueue.md new file mode 100644 index 000000000000..dc04c41724d8 --- /dev/null +++ b/swaggerci/storage/docs/Update-AzStorageQueue.md @@ -0,0 +1,240 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragequeue +schema: 2.0.0 +--- + +# Update-AzStorageQueue + +## SYNOPSIS +Creates a new queue with the specified queue name, under the specified account. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageQueue -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-QueuePropertyMetadata ] [-DefaultProfile ] [-Confirm] + [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageQueue -InputObject [-QueuePropertyMetadata ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +## DESCRIPTION +Creates a new queue with the specified queue name, under the specified account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: QueueName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -QueuePropertyMetadata +A name-value pair that represents queue metadata. + +```yaml +Type: System.Collections.Hashtable +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +## RELATED LINKS + diff --git a/swaggerci/storage/docs/Update-AzStorageTable.md b/swaggerci/storage/docs/Update-AzStorageTable.md new file mode 100644 index 000000000000..db3a74305a32 --- /dev/null +++ b/swaggerci/storage/docs/Update-AzStorageTable.md @@ -0,0 +1,248 @@ +--- +external help file: +Module Name: Az.Storage +online version: https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragetable +schema: 2.0.0 +--- + +# Update-AzStorageTable + +## SYNOPSIS +Creates a new table with the specified table name, under the specified account. + +## SYNTAX + +### UpdateExpanded (Default) +``` +Update-AzStorageTable -AccountName -Name -ResourceGroupName + [-SubscriptionId ] [-TablePropertySignedIdentifier ] + [-DefaultProfile ] [-Confirm] [-WhatIf] [] +``` + +### UpdateViaIdentityExpanded +``` +Update-AzStorageTable -InputObject + [-TablePropertySignedIdentifier ] [-DefaultProfile ] [-Confirm] [-WhatIf] + [] +``` + +## DESCRIPTION +Creates a new table with the specified table name, under the specified account. + +## EXAMPLES + +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +## PARAMETERS + +### -AccountName +The name of the storage account within the specified resource group. +Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -DefaultProfile +The credentials, account, tenant, and subscription used for communication with Azure. + +```yaml +Type: System.Management.Automation.PSObject +Parameter Sets: (All) +Aliases: AzureRMContext, AzureCredential + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -InputObject +Identity Parameter +To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +Parameter Sets: UpdateViaIdentityExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: True (ByValue) +Accept wildcard characters: False +``` + +### -Name +A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: TableName + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -ResourceGroupName +The name of the resource group within the user's subscription. +The name is case insensitive. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: True +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -SubscriptionId +The ID of the target subscription. + +```yaml +Type: System.String +Parameter Sets: UpdateExpanded +Aliases: + +Required: False +Position: Named +Default value: (Get-AzContext).Subscription.Id +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -TablePropertySignedIdentifier +List of stored access policies specified on the table. +To construct, see NOTES section for TABLEPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + +```yaml +Type: Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] +Parameter Sets: (All) +Aliases: + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -Confirm +Prompts you for confirmation before running the cmdlet. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: cf + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### -WhatIf +Shows what would happen if the cmdlet runs. +The cmdlet is not run. + +```yaml +Type: System.Management.Automation.SwitchParameter +Parameter Sets: (All) +Aliases: wi + +Required: False +Position: Named +Default value: None +Accept pipeline input: False +Accept wildcard characters: False +``` + +### CommonParameters +This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216). + +## INPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity + +## OUTPUTS + +### Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + +## NOTES + +ALIASES + +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + + +`INPUTOBJECT `: Identity Parameter + - `[AccountName ]`: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + - `[BlobInventoryPolicyName ]`: The name of the storage account blob inventory policy. It should always be 'default' + - `[BlobServicesName ]`: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + - `[ContainerName ]`: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[DeletedAccountName ]`: Name of the deleted storage account. + - `[EncryptionScopeName ]`: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[FileServicesName ]`: The name of the file Service within the specified storage account. File Service Name must be "default" + - `[Id ]`: Resource identity path + - `[ImmutabilityPolicyName ]`: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + - `[Location ]`: The location of the deleted storage account. + - `[ManagementPolicyName ]`: The name of the Storage Account Management Policy. It should always be 'default' + - `[ObjectReplicationPolicyId ]`: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + - `[PrivateEndpointConnectionName ]`: The name of the private endpoint connection associated with the Azure resource + - `[QueueName ]`: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + - `[QueueServiceName ]`: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + - `[ResourceGroupName ]`: The name of the resource group within the user's subscription. The name is case insensitive. + - `[ShareName ]`: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + - `[SubscriptionId ]`: The ID of the target subscription. + - `[TableName ]`: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + - `[TableServiceName ]`: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + - `[Username ]`: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +`TABLEPROPERTYSIGNEDIDENTIFIER `: List of stored access policies specified on the table. + - `Id `: unique-64-character-value of the stored access policy. + - `[AccessPolicyExpiryTime ]`: Expiry time of the access policy + - `[AccessPolicyPermission ]`: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + - `[AccessPolicyStartTime ]`: Start time of the access policy + +## RELATED LINKS + diff --git a/swaggerci/storage/examples/Clear-AzStorageBlobContainerLegalHold.md b/swaggerci/storage/examples/Clear-AzStorageBlobContainerLegalHold.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Clear-AzStorageBlobContainerLegalHold.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageAccount.md b/swaggerci/storage/examples/Get-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageAccount.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageAccountKey.md b/swaggerci/storage/examples/Get-AzStorageAccountKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageAccountKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageAccountProperty.md b/swaggerci/storage/examples/Get-AzStorageAccountProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageAccountProperty.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageAccountSas.md b/swaggerci/storage/examples/Get-AzStorageAccountSas.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageAccountSas.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageAccountServiceSas.md b/swaggerci/storage/examples/Get-AzStorageAccountServiceSas.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageAccountServiceSas.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageBlobContainer.md b/swaggerci/storage/examples/Get-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageBlobContainer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/examples/Get-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageBlobInventoryPolicy.md b/swaggerci/storage/examples/Get-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageBlobService.md b/swaggerci/storage/examples/Get-AzStorageBlobService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageBlobService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageBlobServiceProperty.md b/swaggerci/storage/examples/Get-AzStorageBlobServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageBlobServiceProperty.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageDeletedAccount.md b/swaggerci/storage/examples/Get-AzStorageDeletedAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageDeletedAccount.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageEncryptionScope.md b/swaggerci/storage/examples/Get-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageEncryptionScope.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageFileService.md b/swaggerci/storage/examples/Get-AzStorageFileService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageFileService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageFileServiceProperty.md b/swaggerci/storage/examples/Get-AzStorageFileServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageFileServiceProperty.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageFileShare.md b/swaggerci/storage/examples/Get-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageLocalUser.md b/swaggerci/storage/examples/Get-AzStorageLocalUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageLocalUser.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageLocalUserKey.md b/swaggerci/storage/examples/Get-AzStorageLocalUserKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageLocalUserKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageManagementPolicy.md b/swaggerci/storage/examples/Get-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageManagementPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageObjectReplicationPolicy.md b/swaggerci/storage/examples/Get-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStoragePrivateEndpointConnection.md b/swaggerci/storage/examples/Get-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStoragePrivateEndpointConnection.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStoragePrivateLinkResource.md b/swaggerci/storage/examples/Get-AzStoragePrivateLinkResource.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStoragePrivateLinkResource.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageQueue.md b/swaggerci/storage/examples/Get-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageQueue.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageQueueService.md b/swaggerci/storage/examples/Get-AzStorageQueueService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageQueueService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageQueueServiceProperty.md b/swaggerci/storage/examples/Get-AzStorageQueueServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageQueueServiceProperty.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageSku.md b/swaggerci/storage/examples/Get-AzStorageSku.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageSku.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageTable.md b/swaggerci/storage/examples/Get-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageTable.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageTableService.md b/swaggerci/storage/examples/Get-AzStorageTableService.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageTableService.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageTableServiceProperty.md b/swaggerci/storage/examples/Get-AzStorageTableServiceProperty.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageTableServiceProperty.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Get-AzStorageUsage.md b/swaggerci/storage/examples/Get-AzStorageUsage.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Get-AzStorageUsage.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md b/swaggerci/storage/examples/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md b/swaggerci/storage/examples/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md b/swaggerci/storage/examples/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Invoke-AzStorageLeaseBlobContainer.md b/swaggerci/storage/examples/Invoke-AzStorageLeaseBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Invoke-AzStorageLeaseBlobContainer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Invoke-AzStorageLeaseFileShare.md b/swaggerci/storage/examples/Invoke-AzStorageLeaseFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Invoke-AzStorageLeaseFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Invoke-AzStorageObjectBlobContainerLevelWorm.md b/swaggerci/storage/examples/Invoke-AzStorageObjectBlobContainerLevelWorm.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Invoke-AzStorageObjectBlobContainerLevelWorm.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Lock-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/examples/Lock-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Lock-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageAccount.md b/swaggerci/storage/examples/New-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageAccount.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageAccountKey.md b/swaggerci/storage/examples/New-AzStorageAccountKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageAccountKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageBlobContainer.md b/swaggerci/storage/examples/New-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageBlobContainer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/examples/New-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageBlobInventoryPolicy.md b/swaggerci/storage/examples/New-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageFileShare.md b/swaggerci/storage/examples/New-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageLocalUser.md b/swaggerci/storage/examples/New-AzStorageLocalUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageLocalUser.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageLocalUserPassword.md b/swaggerci/storage/examples/New-AzStorageLocalUserPassword.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageLocalUserPassword.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageManagementPolicy.md b/swaggerci/storage/examples/New-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageManagementPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageObjectReplicationPolicy.md b/swaggerci/storage/examples/New-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageQueue.md b/swaggerci/storage/examples/New-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageQueue.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/New-AzStorageTable.md b/swaggerci/storage/examples/New-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/New-AzStorageTable.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageAccount.md b/swaggerci/storage/examples/Remove-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageAccount.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageBlobContainer.md b/swaggerci/storage/examples/Remove-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageBlobContainer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageBlobContainerImmutabilityPolicy.md b/swaggerci/storage/examples/Remove-AzStorageBlobContainerImmutabilityPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageBlobContainerImmutabilityPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageBlobInventoryPolicy.md b/swaggerci/storage/examples/Remove-AzStorageBlobInventoryPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageBlobInventoryPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageFileShare.md b/swaggerci/storage/examples/Remove-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageLocalUser.md b/swaggerci/storage/examples/Remove-AzStorageLocalUser.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageLocalUser.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageManagementPolicy.md b/swaggerci/storage/examples/Remove-AzStorageManagementPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageManagementPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageObjectReplicationPolicy.md b/swaggerci/storage/examples/Remove-AzStorageObjectReplicationPolicy.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageObjectReplicationPolicy.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStoragePrivateEndpointConnection.md b/swaggerci/storage/examples/Remove-AzStoragePrivateEndpointConnection.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStoragePrivateEndpointConnection.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageQueue.md b/swaggerci/storage/examples/Remove-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageQueue.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Remove-AzStorageTable.md b/swaggerci/storage/examples/Remove-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Remove-AzStorageTable.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Restore-AzStorageAccountBlobRange.md b/swaggerci/storage/examples/Restore-AzStorageAccountBlobRange.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Restore-AzStorageAccountBlobRange.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Restore-AzStorageFileShare.md b/swaggerci/storage/examples/Restore-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Restore-AzStorageFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Revoke-AzStorageAccountUserDelegationKey.md b/swaggerci/storage/examples/Revoke-AzStorageAccountUserDelegationKey.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Revoke-AzStorageAccountUserDelegationKey.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Test-AzStorageAccountNameAvailability.md b/swaggerci/storage/examples/Test-AzStorageAccountNameAvailability.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Test-AzStorageAccountNameAvailability.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Update-AzStorageAccount.md b/swaggerci/storage/examples/Update-AzStorageAccount.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Update-AzStorageAccount.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Update-AzStorageBlobContainer.md b/swaggerci/storage/examples/Update-AzStorageBlobContainer.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Update-AzStorageBlobContainer.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Update-AzStorageEncryptionScope.md b/swaggerci/storage/examples/Update-AzStorageEncryptionScope.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Update-AzStorageEncryptionScope.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Update-AzStorageFileShare.md b/swaggerci/storage/examples/Update-AzStorageFileShare.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Update-AzStorageFileShare.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Update-AzStorageQueue.md b/swaggerci/storage/examples/Update-AzStorageQueue.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Update-AzStorageQueue.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/examples/Update-AzStorageTable.md b/swaggerci/storage/examples/Update-AzStorageTable.md new file mode 100644 index 000000000000..6ee1a83db970 --- /dev/null +++ b/swaggerci/storage/examples/Update-AzStorageTable.md @@ -0,0 +1,22 @@ +### Example 1: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + +### Example 2: {{ Add title here }} +```powershell +{{ Add code here }} +``` + +```output +{{ Add output here }} +``` + +{{ Add description here }} + diff --git a/swaggerci/storage/export-surface.ps1 b/swaggerci/storage/export-surface.ps1 new file mode 100644 index 000000000000..90779898eaf3 --- /dev/null +++ b/swaggerci/storage/export-surface.ps1 @@ -0,0 +1,33 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$IncludeGeneralParameters, [switch]$UseExpandedFormat) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$dll = Join-Path $PSScriptRoot 'bin/Az.Storage.private.dll' +if(-not (Test-Path $dll)) { + Write-Error "Unable to find output assembly in '$binFolder'." +} +$null = Import-Module -Name $dll + +$moduleName = 'Az.Storage' +$exportsFolder = Join-Path $PSScriptRoot 'exports' +$resourcesFolder = Join-Path $PSScriptRoot 'resources' + +Export-CmdletSurface -ModuleName $moduleName -CmdletFolder $exportsFolder -OutputFolder $resourcesFolder -IncludeGeneralParameters $IncludeGeneralParameters.IsPresent -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "CmdletSurface file(s) created in '$resourcesFolder'" + +Export-ModelSurface -OutputFolder $resourcesFolder -UseExpandedFormat $UseExpandedFormat.IsPresent +Write-Host -ForegroundColor Green "ModelSurface file created in '$resourcesFolder'" + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storage/exports/Clear-AzStorageBlobContainerLegalHold.ps1 b/swaggerci/storage/exports/Clear-AzStorageBlobContainerLegalHold.ps1 new file mode 100644 index 000000000000..f8517d69066b --- /dev/null +++ b/swaggerci/storage/exports/Clear-AzStorageBlobContainerLegalHold.ps1 @@ -0,0 +1,258 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Clears legal hold tags. +Clearing the same or non-existent tag results in an idempotent operation. +ClearLegalHold clears out only the specified tags in the request. +.Description +Clears legal hold tags. +Clearing the same or non-existent tag results in an idempotent operation. +ClearLegalHold clears out only the specified tags in the request. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +LEGALHOLD : The LegalHold property of a blob container. + Tag : Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + [AllowProtectedAppendWritesAll ]: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/clear-azstorageblobcontainerlegalhold +#> +function Clear-AzStorageBlobContainerLegalHold { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold])] +[CmdletBinding(DefaultParameterSetName='ClearExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Clear')] + [Parameter(ParameterSetName='ClearExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Clear', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold] + # The LegalHold property of a blob container. + # To construct, see NOTES section for LEGALHOLD properties and create a hash table. + ${LegalHold}, + + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + ${Tag}, + + [Parameter(ParameterSetName='ClearExpanded')] + [Parameter(ParameterSetName='ClearViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + ${AllowProtectedAppendWritesAll}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Clear = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_Clear'; + ClearExpanded = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_ClearExpanded'; + ClearViaIdentity = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_ClearViaIdentity'; + ClearViaIdentityExpanded = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_ClearViaIdentityExpanded'; + } + if (('Clear', 'ClearExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageAccount.ps1 b/swaggerci/storage/exports/Get-AzStorageAccount.ps1 new file mode 100644 index 000000000000..e0fe16cb8f15 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageAccount.ps1 @@ -0,0 +1,168 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists all the storage accounts available under the subscription. +Note that storage keys are not returned; use the ListKeys operation for this. +.Description +Lists all the storage accounts available under the subscription. +Note that storage keys are not returned; use the ListKeys operation for this. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccount +#> +function Get-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccount_List'; + List1 = 'Az.Storage.private\Get-AzStorageAccount_List1'; + } + if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageAccountKey.ps1 b/swaggerci/storage/exports/Get-AzStorageAccountKey.ps1 new file mode 100644 index 000000000000..ebf7efa633fa --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageAccountKey.ps1 @@ -0,0 +1,180 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. +.Description +Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountkey +#> +function Get-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand] + # Specifies type of the key to be listed. + # Possible value is kerb. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccountKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageAccountProperty.ps1 b/swaggerci/storage/exports/Get-AzStorageAccountProperty.ps1 new file mode 100644 index 000000000000..65c9f1a3f09c --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageAccountProperty.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. +The ListKeys operation should be used to retrieve storage keys. +.Description +Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. +The ListKeys operation should be used to retrieve storage keys. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountproperty +#> +function Get-AzStorageAccountProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand] + # May be used to expand the properties within account's properties. + # By default, data is not included when fetching properties. + # Currently we only support geoReplicationStats and blobRestoreStatus. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageAccountProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageAccountProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageAccountSas.ps1 b/swaggerci/storage/exports/Get-AzStorageAccountSas.ps1 new file mode 100644 index 000000000000..d92ccf748dce --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageAccountSas.ps1 @@ -0,0 +1,251 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List SAS credentials of a storage account. +.Description +List SAS credentials of a storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARAMETER : The parameters to list SAS credentials of a storage account. + Permission : The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + ResourceType : The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + Service : The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + SharedAccessExpiryTime : The time at which the shared access signature becomes invalid. + [IPAddressOrRange ]: An IP address or a range of IP addresses from which to accept requests. + [KeyToSign ]: The key to sign the account SAS token with. + [Protocol ]: The protocol permitted for a request made with the account SAS. + [SharedAccessStartTime ]: The time at which the SAS becomes valid. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountsas +#> +function Get-AzStorageAccountSas { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters] + # The parameters to list SAS credentials of a storage account. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions] + # The signed permissions for the account SAS. + # Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + ${Permission}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes] + # The signed resource types that are accessible with the account SAS. + # Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + ${ResourceType}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services] + # The signed services accessible with the account SAS. + # Possible values include: Blob (b), Queue (q), Table (t), File (f). + ${Service}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the shared access signature becomes invalid. + ${SharedAccessExpiryTime}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # An IP address or a range of IP addresses from which to accept requests. + ${IPAddressOrRange}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The key to sign the account SAS token with. + ${KeyToSign}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol] + # The protocol permitted for a request made with the account SAS. + ${Protocol}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the SAS becomes valid. + ${SharedAccessStartTime}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccountSas_List'; + ListExpanded = 'Az.Storage.private\Get-AzStorageAccountSas_ListExpanded'; + } + if (('List', 'ListExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageAccountServiceSas.ps1 b/swaggerci/storage/exports/Get-AzStorageAccountServiceSas.ps1 new file mode 100644 index 000000000000..507793737254 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageAccountServiceSas.ps1 @@ -0,0 +1,319 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List service SAS credentials of a specific resource. +.Description +List service SAS credentials of a specific resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARAMETER : The parameters to list service SAS credentials of a specific resource. + CanonicalizedResource : The canonical path to the signed resource. + [CacheControl ]: The response header override for cache control. + [ContentDisposition ]: The response header override for content disposition. + [ContentEncoding ]: The response header override for content encoding. + [ContentLanguage ]: The response header override for content language. + [ContentType ]: The response header override for content type. + [IPAddressOrRange ]: An IP address or a range of IP addresses from which to accept requests. + [Identifier ]: A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + [KeyToSign ]: The key to sign the account SAS token with. + [PartitionKeyEnd ]: The end of partition key. + [PartitionKeyStart ]: The start of partition key. + [Permission ]: The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + [Protocol ]: The protocol permitted for a request made with the account SAS. + [Resource ]: The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). + [RowKeyEnd ]: The end of row key. + [RowKeyStart ]: The start of row key. + [SharedAccessExpiryTime ]: The time at which the shared access signature becomes invalid. + [SharedAccessStartTime ]: The time at which the SAS becomes valid. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountservicesas +#> +function Get-AzStorageAccountServiceSas { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters] + # The parameters to list service SAS credentials of a specific resource. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The canonical path to the signed resource. + ${CanonicalizedResource}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for cache control. + ${CacheControl}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content disposition. + ${ContentDisposition}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content encoding. + ${ContentEncoding}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content language. + ${ContentLanguage}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content type. + ${ContentType}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # An IP address or a range of IP addresses from which to accept requests. + ${IPAddressOrRange}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + ${Identifier}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The key to sign the account SAS token with. + ${KeyToSign}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The end of partition key. + ${PartitionKeyEnd}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The start of partition key. + ${PartitionKeyStart}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions] + # The signed permissions for the service SAS. + # Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + ${Permission}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol] + # The protocol permitted for a request made with the account SAS. + ${Protocol}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource] + # The signed services accessible with the service SAS. + # Possible values include: Blob (b), Container (c), File (f), Share (s). + ${Resource}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The end of row key. + ${RowKeyEnd}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The start of row key. + ${RowKeyStart}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the shared access signature becomes invalid. + ${SharedAccessExpiryTime}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the SAS becomes valid. + ${SharedAccessStartTime}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccountServiceSas_List'; + ListExpanded = 'Az.Storage.private\Get-AzStorageAccountServiceSas_ListExpanded'; + } + if (('List', 'ListExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageBlobContainer.ps1 b/swaggerci/storage/exports/Get-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..e376e545c94a --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageBlobContainer.ps1 @@ -0,0 +1,244 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets properties of a specified container. +.Description +Gets properties of a specified container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobcontainer +#> +function Get-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only container names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude] + # Optional, used to include the properties for soft deleted blob containers. + ${Include}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # Specified maximum number of containers that can be included in the list. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobContainer_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobContainer_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageBlobContainer_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage/exports/Get-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..0e10f99c36b0 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageBlobContainerImmutabilityPolicy.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the existing immutability policy along with the corresponding ETag in response headers and body. +.Description +Gets the existing immutability policy along with the corresponding ETag in response headers and body. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobcontainerimmutabilitypolicy +#> +function Get-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobContainerImmutabilityPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobContainerImmutabilityPolicy_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageBlobInventoryPolicy.ps1 b/swaggerci/storage/exports/Get-AzStorageBlobInventoryPolicy.ps1 new file mode 100644 index 000000000000..b489276d9924 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageBlobInventoryPolicy.ps1 @@ -0,0 +1,213 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the blob inventory policy associated with the specified storage account. +.Description +Gets the blob inventory policy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobinventorypolicy +#> +function Get-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobInventoryPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobInventoryPolicy_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageBlobInventoryPolicy_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageBlobService.ps1 b/swaggerci/storage/exports/Get-AzStorageBlobService.ps1 new file mode 100644 index 000000000000..6b83b6129259 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageBlobService.ps1 @@ -0,0 +1,174 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List blob services of storage account. +It returns a collection of one object named default. +.Description +List blob services of storage account. +It returns a collection of one object named default. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobservice +#> +function Get-AzStorageBlobService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageBlobService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageBlobServiceProperty.ps1 b/swaggerci/storage/exports/Get-AzStorageBlobServiceProperty.ps1 new file mode 100644 index 000000000000..123653c9a55b --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageBlobServiceProperty.ps1 @@ -0,0 +1,209 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobserviceproperty +#> +function Get-AzStorageBlobServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageDeletedAccount.ps1 b/swaggerci/storage/exports/Get-AzStorageDeletedAccount.ps1 new file mode 100644 index 000000000000..2dd090d7b20c --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageDeletedAccount.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get properties of specified deleted account resource. +.Description +Get properties of specified deleted account resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragedeletedaccount +#> +function Get-AzStorageDeletedAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The location of the deleted storage account. + ${Location}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DeletedAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # Name of the deleted storage account. + ${Name}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageDeletedAccount_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageDeletedAccount_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageDeletedAccount_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageEncryptionScope.ps1 b/swaggerci/storage/exports/Get-AzStorageEncryptionScope.ps1 new file mode 100644 index 000000000000..65fe807670e6 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageEncryptionScope.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Returns the properties for the specified encryption scope. +.Description +Returns the properties for the specified encryption scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageencryptionscope +#> +function Get-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('EncryptionScopeName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the encryption scope within the specified storage account. + # Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageEncryptionScope_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageEncryptionScope_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageEncryptionScope_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageFileService.ps1 b/swaggerci/storage/exports/Get-AzStorageFileService.ps1 new file mode 100644 index 000000000000..ffbdac051cae --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageFileService.ps1 @@ -0,0 +1,172 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List all file services in storage accounts +.Description +List all file services in storage accounts +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileservice +#> +function Get-AzStorageFileService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageFileService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageFileServiceProperty.ps1 b/swaggerci/storage/exports/Get-AzStorageFileServiceProperty.ps1 new file mode 100644 index 000000000000..8803758d981e --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageFileServiceProperty.ps1 @@ -0,0 +1,209 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileserviceproperty +#> +function Get-AzStorageFileServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageFileServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageFileServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageFileShare.ps1 b/swaggerci/storage/exports/Get-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..45208e038607 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageFileShare.ps1 @@ -0,0 +1,252 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets properties of a specified share. +.Description +Gets properties of a specified share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileshare +#> +function Get-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, used to expand the properties within share's properties. + # Valid values are: stats. + # Should be passed as a string with delimiter ','. + ${Expand}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only share names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # Specified maximum number of shares that can be included in the list. + ${Maxpagesize}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # Optional, used to retrieve properties of a snapshot. + ${XmsSnapshot}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageFileShare_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageFileShare_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageFileShare_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageLocalUser.ps1 b/swaggerci/storage/exports/Get-AzStorageLocalUser.ps1 new file mode 100644 index 000000000000..0962a1c18373 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageLocalUser.ps1 @@ -0,0 +1,221 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the local user of the storage account by username. +.Description +Get the local user of the storage account by username. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragelocaluser +#> +function Get-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageLocalUser_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageLocalUser_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageLocalUser_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageLocalUserKey.ps1 b/swaggerci/storage/exports/Get-AzStorageLocalUserKey.ps1 new file mode 100644 index 000000000000..6edecacfa231 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageLocalUserKey.ps1 @@ -0,0 +1,180 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List SSH authorized keys and shared key of the local user. +.Description +List SSH authorized keys and shared key of the local user. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragelocaluserkey +#> +function Get-AzStorageLocalUserKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageLocalUserKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageManagementPolicy.ps1 b/swaggerci/storage/exports/Get-AzStorageManagementPolicy.ps1 new file mode 100644 index 000000000000..3df16bcdc67f --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageManagementPolicy.ps1 @@ -0,0 +1,209 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the managementpolicy associated with the specified storage account. +.Description +Gets the managementpolicy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragemanagementpolicy +#> +function Get-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageManagementPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageManagementPolicy_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageObjectReplicationPolicy.ps1 b/swaggerci/storage/exports/Get-AzStorageObjectReplicationPolicy.ps1 new file mode 100644 index 000000000000..f203a76bc0b8 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageObjectReplicationPolicy.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Get the object replication policy of the storage account by policy ID. +.Description +Get the object replication policy of the storage account by policy ID. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageobjectreplicationpolicy +#> +function Get-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ObjectReplicationPolicyId')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # For the destination account, provide the value 'default'. + # Configure the policy on the destination account first. + # For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. + # The policy is downloaded as a JSON file. + ${Id}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageObjectReplicationPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageObjectReplicationPolicy_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageObjectReplicationPolicy_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStoragePrivateEndpointConnection.ps1 b/swaggerci/storage/exports/Get-AzStoragePrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..42626005e6b8 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStoragePrivateEndpointConnection.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the specified private endpoint connection associated with the storage account. +.Description +Gets the specified private endpoint connection associated with the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageprivateendpointconnection +#> +function Get-AzStoragePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the private endpoint connection associated with the Azure resource + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStoragePrivateEndpointConnection_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStoragePrivateEndpointConnection_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStoragePrivateEndpointConnection_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStoragePrivateLinkResource.ps1 b/swaggerci/storage/exports/Get-AzStoragePrivateLinkResource.ps1 new file mode 100644 index 000000000000..69575ef99f51 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStoragePrivateLinkResource.ps1 @@ -0,0 +1,172 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the private link resources that need to be created for a storage account. +.Description +Gets the private link resources that need to be created for a storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageprivatelinkresource +#> +function Get-AzStoragePrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStoragePrivateLinkResource_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageQueue.ps1 b/swaggerci/storage/exports/Get-AzStorageQueue.ps1 new file mode 100644 index 000000000000..9f182275af75 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageQueue.ps1 @@ -0,0 +1,234 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the queue with the specified queue name, under the specified account if it exists. +.Description +Gets the queue with the specified queue name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeue +#> +function Get-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, When specified, only the queues with a name starting with the given filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, a maximum number of queues that should be included in a list queue response + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageQueue_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageQueue_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageQueue_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageQueueService.ps1 b/swaggerci/storage/exports/Get-AzStorageQueueService.ps1 new file mode 100644 index 000000000000..64abe455fa2d --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageQueueService.ps1 @@ -0,0 +1,172 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List all queue services for the storage account +.Description +List all queue services for the storage account +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeueservice +#> +function Get-AzStorageQueueService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageQueueService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageQueueServiceProperty.ps1 b/swaggerci/storage/exports/Get-AzStorageQueueServiceProperty.ps1 new file mode 100644 index 000000000000..9facad31f3c8 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageQueueServiceProperty.ps1 @@ -0,0 +1,209 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeueserviceproperty +#> +function Get-AzStorageQueueServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageQueueServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageQueueServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageSku.ps1 b/swaggerci/storage/exports/Get-AzStorageSku.ps1 new file mode 100644 index 000000000000..3175af82856c --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageSku.ps1 @@ -0,0 +1,158 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists the available SKUs supported by Microsoft.Storage for given subscription. +.Description +Lists the available SKUs supported by Microsoft.Storage for given subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragesku +#> +function Get-AzStorageSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageSku_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageTable.ps1 b/swaggerci/storage/exports/Get-AzStorageTable.ps1 new file mode 100644 index 000000000000..ce8db6206431 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageTable.ps1 @@ -0,0 +1,220 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the table with the specified table name, under the specified account if it exists. +.Description +Gets the table with the specified table name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetable +#> +function Get-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageTable_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageTable_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageTable_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageTableService.ps1 b/swaggerci/storage/exports/Get-AzStorageTableService.ps1 new file mode 100644 index 000000000000..db540fab7a63 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageTableService.ps1 @@ -0,0 +1,172 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +List all table services for the storage account. +.Description +List all table services for the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetableservice +#> +function Get-AzStorageTableService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageTableService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageTableServiceProperty.ps1 b/swaggerci/storage/exports/Get-AzStorageTableServiceProperty.ps1 new file mode 100644 index 000000000000..e2c03c3bb3db --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageTableServiceProperty.ps1 @@ -0,0 +1,209 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetableserviceproperty +#> +function Get-AzStorageTableServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageTableServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageTableServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Get-AzStorageUsage.ps1 b/swaggerci/storage/exports/Get-AzStorageUsage.ps1 new file mode 100644 index 000000000000..f045c93c2216 --- /dev/null +++ b/swaggerci/storage/exports/Get-AzStorageUsage.ps1 @@ -0,0 +1,164 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Gets the current usage count and the limit for the resources of the location under the subscription. +.Description +Gets the current usage count and the limit for the resources of the location under the subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageusage +#> +function Get-AzStorageUsage { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The location of the Azure Storage resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageUsage_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.ps1 b/swaggerci/storage/exports/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.ps1 new file mode 100644 index 000000000000..684ffaa8f838 --- /dev/null +++ b/swaggerci/storage/exports/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.ps1 @@ -0,0 +1,227 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Abort live Migration of storage account to enable Hns +.Description +Abort live Migration of storage account to enable Hns +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageabortstorageaccounthierarchicalnamespacemigration +#> +function Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Abort', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Abort')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AbortViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Abort = 'Az.Storage.private\Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort'; + AbortViaIdentity = 'Az.Storage.private\Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity'; + } + if (('Abort') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage/exports/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..063613179810 --- /dev/null +++ b/swaggerci/storage/exports/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.ps1 @@ -0,0 +1,280 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. +The only action allowed on a Locked policy will be this action. +ETag in If-Match is required for this operation. +.Description +Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. +The only action allowed on a Locked policy will be this action. +ETag in If-Match is required for this operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + [AllowProtectedAppendWrite ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + [AllowProtectedAppendWritesAll ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + [ETag ]: + [ImmutabilityPeriodSinceCreationInDay ]: The immutability period for the blobs in the container since the policy creation, in days. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageextendblobcontainerimmutabilitypolicy +#> +function Invoke-AzStorageExtendBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='ExtendExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Extend', Mandatory)] + [Parameter(ParameterSetName='ExtendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Extend', Mandatory)] + [Parameter(ParameterSetName='ExtendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Extend', Mandatory)] + [Parameter(ParameterSetName='ExtendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Extend')] + [Parameter(ParameterSetName='ExtendExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ExtendViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter(ParameterSetName='Extend', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ExtendViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy] + # The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ExtendExpanded')] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + ${AllowProtectedAppendWrite}, + + [Parameter(ParameterSetName='ExtendExpanded')] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + # The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + ${AllowProtectedAppendWritesAll}, + + [Parameter(ParameterSetName='ExtendExpanded')] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Extend = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_Extend'; + ExtendExpanded = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded'; + ExtendViaIdentity = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity'; + ExtendViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded'; + } + if (('Extend', 'ExtendExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.ps1 b/swaggerci/storage/exports/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.ps1 new file mode 100644 index 000000000000..9c4b43fef111 --- /dev/null +++ b/swaggerci/storage/exports/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.ps1 @@ -0,0 +1,235 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Live Migration of storage account to enable Hns +.Description +Live Migration of storage account to enable Hns +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstoragehierarchicalstorageaccountnamespacemigration +#> +function Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Hierarchical', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Hierarchical', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Hierarchical', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Hierarchical')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='HierarchicalViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Required. + # Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. + # The validation request will validate the migration whereas the hydration request will migrate the account. + ${RequestType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Hierarchical = 'Az.Storage.private\Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical'; + HierarchicalViaIdentity = 'Az.Storage.private\Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity'; + } + if (('Hierarchical') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Invoke-AzStorageLeaseBlobContainer.ps1 b/swaggerci/storage/exports/Invoke-AzStorageLeaseBlobContainer.ps1 new file mode 100644 index 000000000000..9a925de60665 --- /dev/null +++ b/swaggerci/storage/exports/Invoke-AzStorageLeaseBlobContainer.ps1 @@ -0,0 +1,284 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The Lease Container operation establishes and manages a lock on a container for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Description +The Lease Container operation establishes and manages a lock on a container for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : Lease Container request schema. + Action : Specifies the lease action. Can be one of the available actions. + [BreakPeriod ]: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + [LeaseDuration ]: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + [LeaseId ]: Identifies the lease. Can be specified in any valid GUID string format. + [ProposedLeaseId ]: Optional for acquire, required for change. Proposed lease ID, in a GUID string format. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageleaseblobcontainer +#> +function Invoke-AzStorageLeaseBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse])] +[CmdletBinding(DefaultParameterSetName='LeaseExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Lease')] + [Parameter(ParameterSetName='LeaseExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Lease', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1] + # Lease Container request schema. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest] + # Specifies the lease action. + # Can be one of the available actions. + ${Action}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Optional. + # For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + ${BreakPeriod}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Required for acquire. + # Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + ${LeaseDuration}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Identifies the lease. + # Can be specified in any valid GUID string format. + ${LeaseId}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Optional for acquire, required for change. + # Proposed lease ID, in a GUID string format. + ${ProposedLeaseId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Lease = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_Lease'; + LeaseExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_LeaseExpanded'; + LeaseViaIdentity = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_LeaseViaIdentity'; + LeaseViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_LeaseViaIdentityExpanded'; + } + if (('Lease', 'LeaseExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Invoke-AzStorageLeaseFileShare.ps1 b/swaggerci/storage/exports/Invoke-AzStorageLeaseFileShare.ps1 new file mode 100644 index 000000000000..df592316e0aa --- /dev/null +++ b/swaggerci/storage/exports/Invoke-AzStorageLeaseFileShare.ps1 @@ -0,0 +1,291 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The Lease Share operation establishes and manages a lock on a share for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Description +The Lease Share operation establishes and manages a lock on a share for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : Lease Share request schema. + Action : Specifies the lease action. Can be one of the available actions. + [BreakPeriod ]: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + [LeaseDuration ]: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + [LeaseId ]: Identifies the lease. Can be specified in any valid GUID string format. + [ProposedLeaseId ]: Optional for acquire, required for change. Proposed lease ID, in a GUID string format. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageleasefileshare +#> +function Invoke-AzStorageLeaseFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse])] +[CmdletBinding(DefaultParameterSetName='LeaseExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Lease')] + [Parameter(ParameterSetName='LeaseExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # Optional. + # Specify the snapshot time to lease a snapshot. + ${XmsSnapshot}, + + [Parameter(ParameterSetName='Lease', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest] + # Lease Share request schema. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction] + # Specifies the lease action. + # Can be one of the available actions. + ${Action}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Optional. + # For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + ${BreakPeriod}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Required for acquire. + # Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + ${LeaseDuration}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Identifies the lease. + # Can be specified in any valid GUID string format. + ${LeaseId}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Optional for acquire, required for change. + # Proposed lease ID, in a GUID string format. + ${ProposedLeaseId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Lease = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_Lease'; + LeaseExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_LeaseExpanded'; + LeaseViaIdentity = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_LeaseViaIdentity'; + LeaseViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_LeaseViaIdentityExpanded'; + } + if (('Lease', 'LeaseExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Invoke-AzStorageObjectBlobContainerLevelWorm.ps1 b/swaggerci/storage/exports/Invoke-AzStorageObjectBlobContainerLevelWorm.ps1 new file mode 100644 index 000000000000..4da4f797df77 --- /dev/null +++ b/swaggerci/storage/exports/Invoke-AzStorageObjectBlobContainerLevelWorm.ps1 @@ -0,0 +1,237 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +This operation migrates a blob container from container level WORM to object level immutability enabled container. +Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. +.Description +This operation migrates a blob container from container level WORM to object level immutability enabled container. +Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageobjectblobcontainerlevelworm +#> +function Invoke-AzStorageObjectBlobContainerLevelWorm { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Object', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Object', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Object', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Object', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Object')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ObjectViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Object = 'Az.Storage.private\Invoke-AzStorageObjectBlobContainerLevelWorm_Object'; + ObjectViaIdentity = 'Az.Storage.private\Invoke-AzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity'; + } + if (('Object') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Lock-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage/exports/Lock-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..c536464f909b --- /dev/null +++ b/swaggerci/storage/exports/Lock-AzStorageBlobContainerImmutabilityPolicy.ps1 @@ -0,0 +1,229 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Sets the ImmutabilityPolicy to Locked state. +The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. +ETag in If-Match is required for this operation. +.Description +Sets the ImmutabilityPolicy to Locked state. +The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. +ETag in If-Match is required for this operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/lock-azstorageblobcontainerimmutabilitypolicy +#> +function Lock-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='Lock', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Lock', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Lock', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Lock', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Lock')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LockViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Lock = 'Az.Storage.private\Lock-AzStorageBlobContainerImmutabilityPolicy_Lock'; + LockViaIdentity = 'Az.Storage.private\Lock-AzStorageBlobContainerImmutabilityPolicy_LockViaIdentity'; + } + if (('Lock') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageAccount.ps1 b/swaggerci/storage/exports/New-AzStorageAccount.ps1 new file mode 100644 index 000000000000..988c55dea79b --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageAccount.ps1 @@ -0,0 +1,583 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Asynchronously creates a new storage account with the specified parameters. +If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. +If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. +.Description +Asynchronously creates a new storage account with the specified parameters. +If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. +If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ENCRYPTION : Encryption settings to be used for server-side encryption for the storage account. + [BlobEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [BlobKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [FileEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [FileKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [IdentityEncryptionFederatedIdentityClientId ]: ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. + [IdentityEncryptionUserAssignedIdentity ]: Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + [KeySource ]: The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + [KeyVaultPropertyKeyName ]: The name of KeyVault key. + [KeyVaultPropertyKeyVaultUri ]: The Uri of KeyVault. + [KeyVaultPropertyKeyVersion ]: The version of KeyVault key. + [QueueEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [QueueKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [RequireInfrastructureEncryption ]: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + [TableEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [TableKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + +NETWORKRULESETIPRULE : Sets the IP ACL rules + IPAddressOrRange : Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + [Action ]: The action of IP ACL rule. + +NETWORKRULESETRESOURCEACCESSRULE : Sets the resource access rules + [ResourceId ]: Resource Id + [TenantId ]: Tenant Id + +NETWORKRULESETVIRTUALNETWORKRULE : Sets the virtual network rules + VirtualNetworkResourceId : Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + [Action ]: The action of virtual network rule. + [State ]: Gets the state of virtual network rule. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageaccount +#> +function New-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind] + # Required. + # Indicates the type of storage account. + ${Kind}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Gets or sets the location of the resource. + # This will be one of the supported and registered Azure Geo Regions (e.g. + # West US, East US, Southeast Asia, etc.). + # The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + ${Location}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName] + # The SKU name. + # Required for account creation; optional for update. + # Note that in older versions, SKU name was called accountType. + ${SkuName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier] + # Required for storage accounts where kind = BlobStorage. + # The access tier is used for billing. + # The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. + ${AccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType] + # Specifies the Active Directory account type for Azure Storage. + ${ActiveDirectoryPropertyAccountType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID) for Azure Storage. + ${ActiveDirectoryPropertyAzureStorageSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the domain GUID. + ${ActiveDirectoryPropertyDomainGuid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the primary domain that the AD DNS server is authoritative for. + ${ActiveDirectoryPropertyDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID). + ${ActiveDirectoryPropertyDomainSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory forest to get. + ${ActiveDirectoryPropertyForestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the NetBIOS domain name. + ${ActiveDirectoryPropertyNetBiosDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory SAMAccountName for Azure Storage. + ${ActiveDirectoryPropertySamAccountName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow public access to all blobs or containers in the storage account. + # The default interpretation is true for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # The default interpretation is true for this property. + ${AllowCrossTenantReplication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. + # If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + # The default value is null, which is equivalent to true. + ${AllowSharedKeyAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope] + # Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + ${AllowedCopyScope}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission] + # Default share permission for users using Kerberos authentication if RBAC role is not assigned. + ${AzureFileIdentityBasedAuthenticationDefaultSharePermission}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions] + # Indicates the directory service used. + # Note that this enum may be extended in the future. + ${AzureFileIdentityBasedAuthenticationDirectoryServiceOption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Gets or sets the custom domain name assigned to the storage account. + # Name is the CNAME source. + ${CustomDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether indirect CName validation is enabled. + # Default value is false. + # This should only be set on updates. + ${CustomDomainUseSubDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether the default authentication is OAuth or not. + # The default interpretation is false for this property. + ${DefaultToOAuthAuthentication}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType] + # Allows you to specify the type of endpoint. + # Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + ${DnsEndpointType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows https traffic only to storage service if sets to true. + # The default value is true since API version 2019-04-01. + ${EnableHttpsTrafficOnly}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # NFS 3.0 protocol support enabled if set to true. + ${EnableNfsV3}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption] + # Encryption settings to be used for server-side encryption for the storage account. + # To construct, see NOTES section for ENCRYPTION properties and create a hash table. + ${Encryption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The name of the extended location. + ${ExtendedLocationName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes] + # The type of the extended location. + ${ExtendedLocationType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType] + # The identity type. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. + # The key is the ARM resource identifier of the identity. + # Only 1 User Assigned identity is permitted here. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for disabled and unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + ${ImmutabilityPolicyAllowProtectedAppendWrite}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState] + # The ImmutabilityPolicy state defines the mode of the policy. + # Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. + # A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. + # Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted. + ${ImmutabilityPolicyState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which enables account-level immutability. + # All the containers under such an account have object-level immutability enabled by default. + ${ImmutableStorageWithVersioningEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Account HierarchicalNamespace enabled if sets to true. + ${IsHnsEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables local users feature, if set to true + ${IsLocalUserEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables Secure File Transfer Protocol, if set to true + ${IsSftpEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The key expiration period in days. + ${KeyPolicyKeyExpirationPeriodInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState] + # Allow large file shares if sets to Enabled. + # It cannot be disabled once it is enabled. + ${LargeFileSharesState}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion] + # Set the minimum TLS version to be permitted on requests to storage. + # The default interpretation is TLS 1.0 for this property. + ${MinimumTlsVersion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass] + # Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + # Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + ${NetworkRuleSetBypass}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction] + # Specifies the default action of allow or deny when no other rules match. + ${NetworkRuleSetDefaultAction}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]] + # Sets the IP ACL rules + # To construct, see NOTES section for NETWORKRULESETIPRULE properties and create a hash table. + ${NetworkRuleSetIPRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]] + # Sets the resource access rules + # To construct, see NOTES section for NETWORKRULESETRESOURCEACCESSRULE properties and create a hash table. + ${NetworkRuleSetResourceAccessRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]] + # Sets the virtual network rules + # To construct, see NOTES section for NETWORKRULESETVIRTUALNETWORKRULE properties and create a hash table. + ${NetworkRuleSetVirtualNetworkRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess] + # Allow or disallow public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether internet routing storage endpoints are to be published + ${RoutingPreferencePublishInternetEndpoint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether microsoft routing storage endpoints are to be published + ${RoutingPreferencePublishMicrosoftEndpoint}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice] + # Routing Choice defines the kind of network routing opted by the user. + ${RoutingPreferenceRoutingChoice}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The SAS expiration period, DD.HH:MM:SS. + ${SasPolicySasExpirationPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the resource. + # These tags can be used for viewing and grouping this resource (across resource groups). + # A maximum of 15 tags can be provided for a resource. + # Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageAccount_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageAccountKey.ps1 b/swaggerci/storage/exports/New-AzStorageAccountKey.ps1 new file mode 100644 index 000000000000..b3ec023c0746 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageAccountKey.ps1 @@ -0,0 +1,235 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Regenerates one of the access keys or Kerberos keys for the specified storage account. +.Description +Regenerates one of the access keys or Kerberos keys for the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +REGENERATEKEY : The parameters used to regenerate the storage account key. + KeyName : The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageaccountkey +#> +function New-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters] + # The parameters used to regenerate the storage account key. + # To construct, see NOTES section for REGENERATEKEY properties and create a hash table. + ${RegenerateKey}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.Storage.private\New-AzStorageAccountKey_Regenerate'; + RegenerateExpanded = 'Az.Storage.private\New-AzStorageAccountKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.Storage.private\New-AzStorageAccountKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.Storage.private\New-AzStorageAccountKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageBlobContainer.ps1 b/swaggerci/storage/exports/New-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..cd9e8c11559b --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageBlobContainer.ps1 @@ -0,0 +1,210 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new container under the specified account as described by request body. +The container resource includes metadata and properties for that container. +It does not include a list of the blobs contained by the container. +.Description +Creates a new container under the specified account as described by request body. +The container resource includes metadata and properties for that container. +It does not include a list of the blobs contained by the container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CONTAINERPROPERTY : Properties of the blob container. + [AllowProtectedAppendWrite ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + [AllowProtectedAppendWritesAll ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + [DefaultEncryptionScope ]: Default the container to use specified encryption scope for all writes. + [DenyEncryptionScopeOverride ]: Block override of encryption scope from the container default. + [EnableNfsV3AllSquash ]: Enable NFSv3 all squash on blob container. + [EnableNfsV3RootSquash ]: Enable NFSv3 root squash on blob container. + [ImmutabilityPeriodSinceCreationInDay ]: The immutability period for the blobs in the container since the policy creation, in days. + [ImmutableStorageWithVersioningEnabled ]: This is an immutable property, when set to true it enables object level immutability at the container level. + [LegalHoldTag ]: The list of LegalHold tags of a blob container. + [Metadata ]: A name-value pair to associate with the container as metadata. + [(Any) ]: This indicates any property can be added to this object. + [ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll ]: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + [PublicAccess ]: Specifies whether data in the container may be accessed publicly and the level of access. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobcontainer +#> +function New-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties] + # Properties of the blob container. + # To construct, see NOTES section for CONTAINERPROPERTY properties and create a hash table. + ${ContainerProperty}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageBlobContainer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage/exports/New-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..9b1d46a7ebc6 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageBlobContainerImmutabilityPolicy.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates or updates an unlocked immutability policy. +ETag in If-Match is honored if given but not required for this operation. +.Description +Creates or updates an unlocked immutability policy. +ETag in If-Match is honored if given but not required for this operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobcontainerimmutabilitypolicy +#> +function New-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + ${AllowProtectedAppendWrite}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + # The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + ${AllowProtectedAppendWritesAll}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageBlobContainerImmutabilityPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageBlobInventoryPolicy.ps1 b/swaggerci/storage/exports/New-AzStorageBlobInventoryPolicy.ps1 new file mode 100644 index 000000000000..b854417f704d --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageBlobInventoryPolicy.ps1 @@ -0,0 +1,206 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Sets the blob inventory policy to the specified storage account. +.Description +Sets the blob inventory policy to the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +POLICYRULE : The storage account blob inventory policy rules. The rule is applied when it is enabled. + DefinitionFormat : This is a required field, it specifies the format for the inventory files. + DefinitionObjectType : This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + DefinitionSchedule : This is a required field. This field is used to schedule an inventory formation. + DefinitionSchemaField : This is a required field. This field specifies the fields and properties of the object to be included in the inventory. The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts. + Destination : Container name where blob inventory files are stored. Must be pre-created. + Enabled : Rule is enabled when set to true. + Name : A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + [FilterBlobType ]: An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + [FilterExcludePrefix ]: An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + [FilterIncludeBlobVersion ]: Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, else they must be excluded. + [FilterIncludeDeleted ]: For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be excluded. + [FilterIncludeSnapshot ]: Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded. + [FilterPrefixMatch ]: An array of strings with maximum 10 blob prefixes to be included in the inventory. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobinventorypolicy +#> +function New-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Policy is enabled if set to true. + ${PolicyEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]] + # The storage account blob inventory policy rules. + # The rule is applied when it is enabled. + # To construct, see NOTES section for POLICYRULE properties and create a hash table. + ${PolicyRule}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageBlobInventoryPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageFileShare.ps1 b/swaggerci/storage/exports/New-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..37fe856c9ee8 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageFileShare.ps1 @@ -0,0 +1,250 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new share under the specified account as described by request body. +The share resource includes metadata and properties for that share. +It does not include a list of the files contained by the share. +.Description +Creates a new share under the specified account as described by request body. +The share resource includes metadata and properties for that share. +It does not include a list of the files contained by the share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILESHAREPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the share. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: List of abbreviated permissions. + [AccessPolicyStartTime ]: Start time of the access policy + [Id ]: An unique identifier of the stored access policy. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragefileshare +#> +function New-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, used to expand the properties within share's properties. + # Valid values are: snapshots. + # Should be passed as a string with delimiter ',' + ${Expand}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier] + # Access tier for specific share. + # GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + # FileStorage account can choose Premium. + ${FileSharePropertyAccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols] + # The authentication protocol that is used for the file share. + # Can only be specified when creating a share. + ${FileSharePropertyEnabledProtocol}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair to associate with the share as metadata. + ${FileSharePropertyMetadata}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType] + # The property is for NFS share only. + # The default is NoRootSquash. + ${FileSharePropertyRootSquash}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The maximum size of the share, in gigabytes. + # Must be greater than 0, and less than or equal to 5TB (5120). + # For Large File Shares, the maximum size is 102400. + ${FileSharePropertyShareQuota}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]] + # List of stored access policies specified on the share. + # To construct, see NOTES section for FILESHAREPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${FileSharePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageFileShare_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageLocalUser.ps1 b/swaggerci/storage/exports/New-AzStorageLocalUser.ps1 new file mode 100644 index 000000000000..79b7cc2c5ee5 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageLocalUser.ps1 @@ -0,0 +1,236 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create or update the properties of a local user associated with the storage account +.Description +Create or update the properties of a local user associated with the storage account +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PERMISSIONSCOPE : The permission scopes of the local user. + Permission : The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c). + ResourceName : The name of resource, normally the container name or the file share name, used by the local user. + Service : The service used by the local user, e.g. blob, file. + +SSHAUTHORIZEDKEY : Optional, local user ssh authorized keys for SFTP. + [Description ]: Optional. It is used to store the function/usage of the key + [Key ]: Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragelocaluser +#> +function New-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether shared key exists. + # Set it to false to remove existing shared key. + ${HasSharedKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether ssh key exists. + # Set it to false to remove existing SSH key. + ${HasSshKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether ssh password exists. + # Set it to false to remove existing SSH password. + ${HasSshPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Optional, local user home directory. + ${HomeDirectory}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[]] + # The permission scopes of the local user. + # To construct, see NOTES section for PERMISSIONSCOPE properties and create a hash table. + ${PermissionScope}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]] + # Optional, local user ssh authorized keys for SFTP. + # To construct, see NOTES section for SSHAUTHORIZEDKEY properties and create a hash table. + ${SshAuthorizedKey}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageLocalUser_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageLocalUserPassword.ps1 b/swaggerci/storage/exports/New-AzStorageLocalUserPassword.ps1 new file mode 100644 index 000000000000..58d9a460aa19 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageLocalUserPassword.ps1 @@ -0,0 +1,217 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Regenerate the local user SSH password. +.Description +Regenerate the local user SSH password. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragelocaluserpassword +#> +function New-AzStorageLocalUserPassword { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Regenerate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.Storage.private\New-AzStorageLocalUserPassword_Regenerate'; + RegenerateViaIdentity = 'Az.Storage.private\New-AzStorageLocalUserPassword_RegenerateViaIdentity'; + } + if (('Regenerate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageManagementPolicy.ps1 b/swaggerci/storage/exports/New-AzStorageManagementPolicy.ps1 new file mode 100644 index 000000000000..14f096fdc926 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageManagementPolicy.ps1 @@ -0,0 +1,221 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Sets the managementpolicy to the specified storage account. +.Description +Sets the managementpolicy to the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +POLICYRULE : The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + DefinitionAction : An object that defines the action set. + [BaseBlobDeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [BaseBlobDeleteDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + [BaseBlobEnableAutoTierToHotFromCool ]: This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + [BaseBlobTierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + [BaseBlobTierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + [DeleteDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [DeleteDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [SnapshotDeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotDeleteDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [SnapshotTierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [SnapshotTierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [TierToArchiveDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToArchiveDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToCoolDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToCoolDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [VersionDeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionDeleteDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [VersionTierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToArchiveDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [VersionTierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToCoolDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + Name : A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + [Enabled ]: Rule is enabled if set to true. + [FilterBlobIndexMatch ]: An array of blob index tag based filters, there can be at most 10 tag filters + Name : This is the filter tag name, it can have 1 - 128 characters + Op : This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported + Value : This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + [FilterBlobType ]: An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are supported for appendBlob. + [FilterPrefixMatch ]: An array of strings for prefixes to be match. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragemanagementpolicy +#> +function New-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]] + # The Storage Account ManagementPolicies Rules. + # See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + # To construct, see NOTES section for POLICYRULE properties and create a hash table. + ${PolicyRule}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageManagementPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageObjectReplicationPolicy.ps1 b/swaggerci/storage/exports/New-AzStorageObjectReplicationPolicy.ps1 new file mode 100644 index 000000000000..0c953cdd6c77 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageObjectReplicationPolicy.ps1 @@ -0,0 +1,217 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Create or update the object replication policy of the storage account. +.Description +Create or update the object replication policy of the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +RULE : The storage account object replication rules. + DestinationContainer : Required. Destination container name. + SourceContainer : Required. Source container name. + [FilterMinCreationTime ]: Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z + [FilterPrefixMatch ]: Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + [RuleId ]: Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageobjectreplicationpolicy +#> +function New-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Alias('ObjectReplicationPolicyId')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # For the destination account, provide the value 'default'. + # Configure the policy on the destination account first. + # For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. + # The policy is downloaded as a JSON file. + ${Id}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Destination account name. + # It should be full resource id if allowCrossTenantReplication set to false. + ${DestinationAccount}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[]] + # The storage account object replication rules. + # To construct, see NOTES section for RULE properties and create a hash table. + ${Rule}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Source account name. + # It should be full resource id if allowCrossTenantReplication set to false. + ${SourceAccount}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageObjectReplicationPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageQueue.ps1 b/swaggerci/storage/exports/New-AzStorageQueue.ps1 new file mode 100644 index 000000000000..d41a74cf9bf7 --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageQueue.ps1 @@ -0,0 +1,186 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new queue with the specified queue name, under the specified account. +.Description +Creates a new queue with the specified queue name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragequeue +#> +function New-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair that represents queue metadata. + ${QueuePropertyMetadata}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageQueue_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/New-AzStorageTable.ps1 b/swaggerci/storage/exports/New-AzStorageTable.ps1 new file mode 100644 index 000000000000..e72def53073f --- /dev/null +++ b/swaggerci/storage/exports/New-AzStorageTable.ps1 @@ -0,0 +1,197 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new table with the specified table name, under the specified account. +.Description +Creates a new table with the specified table name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +TABLEPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the table. + Id : unique-64-character-value of the stored access policy. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + [AccessPolicyStartTime ]: Start time of the access policy +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragetable +#> +function New-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]] + # List of stored access policies specified on the table. + # To construct, see NOTES section for TABLEPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${TablePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageTable_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/ProxyCmdletDefinitions.ps1 b/swaggerci/storage/exports/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..be04bd4b2966 --- /dev/null +++ b/swaggerci/storage/exports/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,15801 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Clears legal hold tags. +Clearing the same or non-existent tag results in an idempotent operation. +ClearLegalHold clears out only the specified tags in the request. +.Description +Clears legal hold tags. +Clearing the same or non-existent tag results in an idempotent operation. +ClearLegalHold clears out only the specified tags in the request. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +LEGALHOLD : The LegalHold property of a blob container. + Tag : Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + [AllowProtectedAppendWritesAll ]: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/clear-azstorageblobcontainerlegalhold +#> +function Clear-AzStorageBlobContainerLegalHold { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold])] +[CmdletBinding(DefaultParameterSetName='ClearExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Clear', Mandatory)] + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Clear')] + [Parameter(ParameterSetName='ClearExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Clear', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ClearViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold] + # The LegalHold property of a blob container. + # To construct, see NOTES section for LEGALHOLD properties and create a hash table. + ${LegalHold}, + + [Parameter(ParameterSetName='ClearExpanded', Mandatory)] + [Parameter(ParameterSetName='ClearViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String[]] + # Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + ${Tag}, + + [Parameter(ParameterSetName='ClearExpanded')] + [Parameter(ParameterSetName='ClearViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + ${AllowProtectedAppendWritesAll}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Clear = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_Clear'; + ClearExpanded = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_ClearExpanded'; + ClearViaIdentity = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_ClearViaIdentity'; + ClearViaIdentityExpanded = 'Az.Storage.private\Clear-AzStorageBlobContainerLegalHold_ClearViaIdentityExpanded'; + } + if (('Clear', 'ClearExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. +.Description +Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountkey +#> +function Get-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand] + # Specifies type of the key to be listed. + # Possible value is kerb. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccountKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. +The ListKeys operation should be used to retrieve storage keys. +.Description +Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. +The ListKeys operation should be used to retrieve storage keys. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountproperty +#> +function Get-AzStorageAccountProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand] + # May be used to expand the properties within account's properties. + # By default, data is not included when fetching properties. + # Currently we only support geoReplicationStats and blobRestoreStatus. + ${Expand}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageAccountProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageAccountProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List SAS credentials of a storage account. +.Description +List SAS credentials of a storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARAMETER : The parameters to list SAS credentials of a storage account. + Permission : The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + ResourceType : The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + Service : The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + SharedAccessExpiryTime : The time at which the shared access signature becomes invalid. + [IPAddressOrRange ]: An IP address or a range of IP addresses from which to accept requests. + [KeyToSign ]: The key to sign the account SAS token with. + [Protocol ]: The protocol permitted for a request made with the account SAS. + [SharedAccessStartTime ]: The time at which the SAS becomes valid. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountsas +#> +function Get-AzStorageAccountSas { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters] + # The parameters to list SAS credentials of a storage account. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions] + # The signed permissions for the account SAS. + # Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + ${Permission}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes] + # The signed resource types that are accessible with the account SAS. + # Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. + ${ResourceType}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services] + # The signed services accessible with the account SAS. + # Possible values include: Blob (b), Queue (q), Table (t), File (f). + ${Service}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the shared access signature becomes invalid. + ${SharedAccessExpiryTime}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # An IP address or a range of IP addresses from which to accept requests. + ${IPAddressOrRange}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The key to sign the account SAS token with. + ${KeyToSign}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol] + # The protocol permitted for a request made with the account SAS. + ${Protocol}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the SAS becomes valid. + ${SharedAccessStartTime}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccountSas_List'; + ListExpanded = 'Az.Storage.private\Get-AzStorageAccountSas_ListExpanded'; + } + if (('List', 'ListExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List service SAS credentials of a specific resource. +.Description +List service SAS credentials of a specific resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PARAMETER : The parameters to list service SAS credentials of a specific resource. + CanonicalizedResource : The canonical path to the signed resource. + [CacheControl ]: The response header override for cache control. + [ContentDisposition ]: The response header override for content disposition. + [ContentEncoding ]: The response header override for content encoding. + [ContentLanguage ]: The response header override for content language. + [ContentType ]: The response header override for content type. + [IPAddressOrRange ]: An IP address or a range of IP addresses from which to accept requests. + [Identifier ]: A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + [KeyToSign ]: The key to sign the account SAS token with. + [PartitionKeyEnd ]: The end of partition key. + [PartitionKeyStart ]: The start of partition key. + [Permission ]: The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + [Protocol ]: The protocol permitted for a request made with the account SAS. + [Resource ]: The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). + [RowKeyEnd ]: The end of row key. + [RowKeyStart ]: The start of row key. + [SharedAccessExpiryTime ]: The time at which the shared access signature becomes invalid. + [SharedAccessStartTime ]: The time at which the SAS becomes valid. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccountservicesas +#> +function Get-AzStorageAccountServiceSas { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='ListExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters] + # The parameters to list service SAS credentials of a specific resource. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ListExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The canonical path to the signed resource. + ${CanonicalizedResource}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for cache control. + ${CacheControl}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content disposition. + ${ContentDisposition}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content encoding. + ${ContentEncoding}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content language. + ${ContentLanguage}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The response header override for content type. + ${ContentType}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # An IP address or a range of IP addresses from which to accept requests. + ${IPAddressOrRange}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. + ${Identifier}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The key to sign the account SAS token with. + ${KeyToSign}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The end of partition key. + ${PartitionKeyEnd}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The start of partition key. + ${PartitionKeyStart}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions] + # The signed permissions for the service SAS. + # Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). + ${Permission}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol] + # The protocol permitted for a request made with the account SAS. + ${Protocol}, + + [Parameter(ParameterSetName='ListExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource] + # The signed services accessible with the service SAS. + # Possible values include: Blob (b), Container (c), File (f), Share (s). + ${Resource}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The end of row key. + ${RowKeyEnd}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The start of row key. + ${RowKeyStart}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the shared access signature becomes invalid. + ${SharedAccessExpiryTime}, + + [Parameter(ParameterSetName='ListExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # The time at which the SAS becomes valid. + ${SharedAccessStartTime}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccountServiceSas_List'; + ListExpanded = 'Az.Storage.private\Get-AzStorageAccountServiceSas_ListExpanded'; + } + if (('List', 'ListExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists all the storage accounts available under the subscription. +Note that storage keys are not returned; use the ListKeys operation for this. +.Description +Lists all the storage accounts available under the subscription. +Note that storage keys are not returned; use the ListKeys operation for this. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageaccount +#> +function Get-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='List1', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageAccount_List'; + List1 = 'Az.Storage.private\Get-AzStorageAccount_List1'; + } + if (('List', 'List1') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the existing immutability policy along with the corresponding ETag in response headers and body. +.Description +Gets the existing immutability policy along with the corresponding ETag in response headers and body. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobcontainerimmutabilitypolicy +#> +function Get-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobContainerImmutabilityPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobContainerImmutabilityPolicy_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets properties of a specified container. +.Description +Gets properties of a specified container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobcontainer +#> +function Get-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only container names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude] + # Optional, used to include the properties for soft deleted blob containers. + ${Include}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # Specified maximum number of containers that can be included in the list. + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobContainer_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobContainer_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageBlobContainer_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the blob inventory policy associated with the specified storage account. +.Description +Gets the blob inventory policy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobinventorypolicy +#> +function Get-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobInventoryPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobInventoryPolicy_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageBlobInventoryPolicy_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobserviceproperty +#> +function Get-AzStorageBlobServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageBlobServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageBlobServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List blob services of storage account. +It returns a collection of one object named default. +.Description +List blob services of storage account. +It returns a collection of one object named default. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageblobservice +#> +function Get-AzStorageBlobService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageBlobService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get properties of specified deleted account resource. +.Description +Get properties of specified deleted account resource. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragedeletedaccount +#> +function Get-AzStorageDeletedAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The location of the deleted storage account. + ${Location}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('DeletedAccountName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # Name of the deleted storage account. + ${Name}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageDeletedAccount_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageDeletedAccount_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageDeletedAccount_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Returns the properties for the specified encryption scope. +.Description +Returns the properties for the specified encryption scope. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageencryptionscope +#> +function Get-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('EncryptionScopeName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the encryption scope within the specified storage account. + # Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageEncryptionScope_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageEncryptionScope_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageEncryptionScope_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileserviceproperty +#> +function Get-AzStorageFileServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageFileServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageFileServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List all file services in storage accounts +.Description +List all file services in storage accounts +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileservice +#> +function Get-AzStorageFileService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageFileService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets properties of a specified share. +.Description +Gets properties of a specified share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragefileshare +#> +function Get-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, used to expand the properties within share's properties. + # Valid values are: stats. + # Should be passed as a string with delimiter ','. + ${Expand}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # When specified, only share names starting with the filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # Specified maximum number of shares that can be included in the list. + ${Maxpagesize}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='GetViaIdentity')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # Optional, used to retrieve properties of a snapshot. + ${XmsSnapshot}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageFileShare_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageFileShare_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageFileShare_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List SSH authorized keys and shared key of the local user. +.Description +List SSH authorized keys and shared key of the local user. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragelocaluserkey +#> +function Get-AzStorageLocalUserKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageLocalUserKey_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the local user of the storage account by username. +.Description +Get the local user of the storage account by username. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragelocaluser +#> +function Get-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageLocalUser_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageLocalUser_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageLocalUser_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the managementpolicy associated with the specified storage account. +.Description +Gets the managementpolicy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragemanagementpolicy +#> +function Get-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageManagementPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageManagementPolicy_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Get the object replication policy of the storage account by policy ID. +.Description +Get the object replication policy of the storage account by policy ID. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageobjectreplicationpolicy +#> +function Get-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('ObjectReplicationPolicyId')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # For the destination account, provide the value 'default'. + # Configure the policy on the destination account first. + # For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. + # The policy is downloaded as a JSON file. + ${Id}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageObjectReplicationPolicy_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageObjectReplicationPolicy_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageObjectReplicationPolicy_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the specified private endpoint connection associated with the storage account. +.Description +Gets the specified private endpoint connection associated with the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageprivateendpointconnection +#> +function Get-AzStoragePrivateEndpointConnection { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the private endpoint connection associated with the Azure resource + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStoragePrivateEndpointConnection_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStoragePrivateEndpointConnection_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStoragePrivateEndpointConnection_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the private link resources that need to be created for a storage account. +.Description +Gets the private link resources that need to be created for a storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageprivatelinkresource +#> +function Get-AzStoragePrivateLinkResource { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStoragePrivateLinkResource_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeueserviceproperty +#> +function Get-AzStorageQueueServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageQueueServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageQueueServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List all queue services for the storage account +.Description +List all queue services for the storage account +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeueservice +#> +function Get-AzStorageQueueService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageQueueService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the queue with the specified queue name, under the specified account if it exists. +.Description +Gets the queue with the specified queue name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragequeue +#> +function Get-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue], [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, When specified, only the queues with a name starting with the given filter will be listed. + ${Filter}, + + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, a maximum number of queues that should be included in a list queue response + ${Maxpagesize}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageQueue_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageQueue_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageQueue_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Lists the available SKUs supported by Microsoft.Storage for given subscription. +.Description +Lists the available SKUs supported by Microsoft.Storage for given subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragesku +#> +function Get-AzStorageSku { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageSku_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Description +Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetableserviceproperty +#> +function Get-AzStorageTableServiceProperty { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties])] +[CmdletBinding(DefaultParameterSetName='Get', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageTableServiceProperty_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageTableServiceProperty_GetViaIdentity'; + } + if (('Get') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +List all table services for the storage account. +.Description +List all table services for the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetableservice +#> +function Get-AzStorageTableService { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageTableService_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the table with the specified table name, under the specified account if it exists. +.Description +Gets the table with the specified table name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstoragetable +#> +function Get-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(ParameterSetName='Get', Mandatory)] + [Parameter(ParameterSetName='List', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Get')] + [Parameter(ParameterSetName='List')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='GetViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Get = 'Az.Storage.private\Get-AzStorageTable_Get'; + GetViaIdentity = 'Az.Storage.private\Get-AzStorageTable_GetViaIdentity'; + List = 'Az.Storage.private\Get-AzStorageTable_List'; + } + if (('Get', 'List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Gets the current usage count and the limit for the resources of the location under the subscription. +.Description +Gets the current usage count and the limit for the resources of the location under the subscription. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageusage +#> +function Get-AzStorageUsage { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The location of the Azure Storage resource. + ${Location}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String[]] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageUsage_List'; + } + if (('List') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Abort live Migration of storage account to enable Hns +.Description +Abort live Migration of storage account to enable Hns +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageabortstorageaccounthierarchicalnamespacemigration +#> +function Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Abort', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Abort', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Abort')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='AbortViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Abort = 'Az.Storage.private\Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort'; + AbortViaIdentity = 'Az.Storage.private\Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity'; + } + if (('Abort') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. +The only action allowed on a Locked policy will be this action. +ETag in If-Match is required for this operation. +.Description +Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. +The only action allowed on a Locked policy will be this action. +ETag in If-Match is required for this operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + [AllowProtectedAppendWrite ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + [AllowProtectedAppendWritesAll ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + [ETag ]: + [ImmutabilityPeriodSinceCreationInDay ]: The immutability period for the blobs in the container since the policy creation, in days. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageextendblobcontainerimmutabilitypolicy +#> +function Invoke-AzStorageExtendBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='ExtendExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Extend', Mandatory)] + [Parameter(ParameterSetName='ExtendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Extend', Mandatory)] + [Parameter(ParameterSetName='ExtendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Extend', Mandatory)] + [Parameter(ParameterSetName='ExtendExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Extend')] + [Parameter(ParameterSetName='ExtendExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ExtendViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter(ParameterSetName='Extend', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='ExtendViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy] + # The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='ExtendExpanded')] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + ${AllowProtectedAppendWrite}, + + [Parameter(ParameterSetName='ExtendExpanded')] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + # The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + ${AllowProtectedAppendWritesAll}, + + [Parameter(ParameterSetName='ExtendExpanded')] + [Parameter(ParameterSetName='ExtendViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Extend = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_Extend'; + ExtendExpanded = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded'; + ExtendViaIdentity = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity'; + ExtendViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded'; + } + if (('Extend', 'ExtendExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Live Migration of storage account to enable Hns +.Description +Live Migration of storage account to enable Hns +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstoragehierarchicalstorageaccountnamespacemigration +#> +function Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Hierarchical', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Hierarchical', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Hierarchical', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Hierarchical')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='HierarchicalViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Required. + # Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. + # The validation request will validate the migration whereas the hydration request will migrate the account. + ${RequestType}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Hierarchical = 'Az.Storage.private\Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical'; + HierarchicalViaIdentity = 'Az.Storage.private\Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity'; + } + if (('Hierarchical') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The Lease Container operation establishes and manages a lock on a container for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Description +The Lease Container operation establishes and manages a lock on a container for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : Lease Container request schema. + Action : Specifies the lease action. Can be one of the available actions. + [BreakPeriod ]: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + [LeaseDuration ]: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + [LeaseId ]: Identifies the lease. Can be specified in any valid GUID string format. + [ProposedLeaseId ]: Optional for acquire, required for change. Proposed lease ID, in a GUID string format. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageleaseblobcontainer +#> +function Invoke-AzStorageLeaseBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse])] +[CmdletBinding(DefaultParameterSetName='LeaseExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Lease')] + [Parameter(ParameterSetName='LeaseExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Lease', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1] + # Lease Container request schema. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest] + # Specifies the lease action. + # Can be one of the available actions. + ${Action}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Optional. + # For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + ${BreakPeriod}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Required for acquire. + # Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + ${LeaseDuration}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Identifies the lease. + # Can be specified in any valid GUID string format. + ${LeaseId}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Optional for acquire, required for change. + # Proposed lease ID, in a GUID string format. + ${ProposedLeaseId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Lease = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_Lease'; + LeaseExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_LeaseExpanded'; + LeaseViaIdentity = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_LeaseViaIdentity'; + LeaseViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseBlobContainer_LeaseViaIdentityExpanded'; + } + if (('Lease', 'LeaseExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The Lease Share operation establishes and manages a lock on a share for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Description +The Lease Share operation establishes and manages a lock on a share for delete operations. +The lock duration can be 15 to 60 seconds, or can be infinite. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : Lease Share request schema. + Action : Specifies the lease action. Can be one of the available actions. + [BreakPeriod ]: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + [LeaseDuration ]: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + [LeaseId ]: Identifies the lease. Can be specified in any valid GUID string format. + [ProposedLeaseId ]: Optional for acquire, required for change. Proposed lease ID, in a GUID string format. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageleasefileshare +#> +function Invoke-AzStorageLeaseFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse])] +[CmdletBinding(DefaultParameterSetName='LeaseExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Lease', Mandatory)] + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Lease')] + [Parameter(ParameterSetName='LeaseExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # Optional. + # Specify the snapshot time to lease a snapshot. + ${XmsSnapshot}, + + [Parameter(ParameterSetName='Lease', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='LeaseViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest] + # Lease Share request schema. + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='LeaseExpanded', Mandatory)] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded', Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction] + # Specifies the lease action. + # Can be one of the available actions. + ${Action}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Optional. + # For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60. + ${BreakPeriod}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # Required for acquire. + # Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + ${LeaseDuration}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Identifies the lease. + # Can be specified in any valid GUID string format. + ${LeaseId}, + + [Parameter(ParameterSetName='LeaseExpanded')] + [Parameter(ParameterSetName='LeaseViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Optional for acquire, required for change. + # Proposed lease ID, in a GUID string format. + ${ProposedLeaseId}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Lease = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_Lease'; + LeaseExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_LeaseExpanded'; + LeaseViaIdentity = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_LeaseViaIdentity'; + LeaseViaIdentityExpanded = 'Az.Storage.private\Invoke-AzStorageLeaseFileShare_LeaseViaIdentityExpanded'; + } + if (('Lease', 'LeaseExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +This operation migrates a blob container from container level WORM to object level immutability enabled container. +Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. +.Description +This operation migrates a blob container from container level WORM to object level immutability enabled container. +Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/invoke-azstorageobjectblobcontainerlevelworm +#> +function Invoke-AzStorageObjectBlobContainerLevelWorm { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Object', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Object', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Object', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Object', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Object')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='ObjectViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Object = 'Az.Storage.private\Invoke-AzStorageObjectBlobContainerLevelWorm_Object'; + ObjectViaIdentity = 'Az.Storage.private\Invoke-AzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity'; + } + if (('Object') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Sets the ImmutabilityPolicy to Locked state. +The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. +ETag in If-Match is required for this operation. +.Description +Sets the ImmutabilityPolicy to Locked state. +The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. +ETag in If-Match is required for this operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/lock-azstorageblobcontainerimmutabilitypolicy +#> +function Lock-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='Lock', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Lock', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Lock', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Lock', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Lock')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='LockViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Lock = 'Az.Storage.private\Lock-AzStorageBlobContainerImmutabilityPolicy_Lock'; + LockViaIdentity = 'Az.Storage.private\Lock-AzStorageBlobContainerImmutabilityPolicy_LockViaIdentity'; + } + if (('Lock') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Regenerates one of the access keys or Kerberos keys for the specified storage account. +.Description +Regenerates one of the access keys or Kerberos keys for the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +REGENERATEKEY : The parameters used to regenerate the storage account key. + KeyName : The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageaccountkey +#> +function New-AzStorageAccountKey { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey])] +[CmdletBinding(DefaultParameterSetName='RegenerateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Parameter(ParameterSetName='RegenerateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Regenerate', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters] + # The parameters used to regenerate the storage account key. + # To construct, see NOTES section for REGENERATEKEY properties and create a hash table. + ${RegenerateKey}, + + [Parameter(ParameterSetName='RegenerateExpanded', Mandatory)] + [Parameter(ParameterSetName='RegenerateViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + ${KeyName}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.Storage.private\New-AzStorageAccountKey_Regenerate'; + RegenerateExpanded = 'Az.Storage.private\New-AzStorageAccountKey_RegenerateExpanded'; + RegenerateViaIdentity = 'Az.Storage.private\New-AzStorageAccountKey_RegenerateViaIdentity'; + RegenerateViaIdentityExpanded = 'Az.Storage.private\New-AzStorageAccountKey_RegenerateViaIdentityExpanded'; + } + if (('Regenerate', 'RegenerateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Asynchronously creates a new storage account with the specified parameters. +If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. +If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. +.Description +Asynchronously creates a new storage account with the specified parameters. +If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. +If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ENCRYPTION : Encryption settings to be used for server-side encryption for the storage account. + [BlobEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [BlobKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [FileEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [FileKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [IdentityEncryptionFederatedIdentityClientId ]: ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. + [IdentityEncryptionUserAssignedIdentity ]: Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + [KeySource ]: The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + [KeyVaultPropertyKeyName ]: The name of KeyVault key. + [KeyVaultPropertyKeyVaultUri ]: The Uri of KeyVault. + [KeyVaultPropertyKeyVersion ]: The version of KeyVault key. + [QueueEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [QueueKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [RequireInfrastructureEncryption ]: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + [TableEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [TableKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + +NETWORKRULESETIPRULE : Sets the IP ACL rules + IPAddressOrRange : Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + [Action ]: The action of IP ACL rule. + +NETWORKRULESETRESOURCEACCESSRULE : Sets the resource access rules + [ResourceId ]: Resource Id + [TenantId ]: Tenant Id + +NETWORKRULESETVIRTUALNETWORKRULE : Sets the virtual network rules + VirtualNetworkResourceId : Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + [Action ]: The action of virtual network rule. + [State ]: Gets the state of virtual network rule. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageaccount +#> +function New-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind] + # Required. + # Indicates the type of storage account. + ${Kind}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Gets or sets the location of the resource. + # This will be one of the supported and registered Azure Geo Regions (e.g. + # West US, East US, Southeast Asia, etc.). + # The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed. + ${Location}, + + [Parameter(Mandatory)] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName] + # The SKU name. + # Required for account creation; optional for update. + # Note that in older versions, SKU name was called accountType. + ${SkuName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier] + # Required for storage accounts where kind = BlobStorage. + # The access tier is used for billing. + # The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. + ${AccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType] + # Specifies the Active Directory account type for Azure Storage. + ${ActiveDirectoryPropertyAccountType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID) for Azure Storage. + ${ActiveDirectoryPropertyAzureStorageSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the domain GUID. + ${ActiveDirectoryPropertyDomainGuid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the primary domain that the AD DNS server is authoritative for. + ${ActiveDirectoryPropertyDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID). + ${ActiveDirectoryPropertyDomainSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory forest to get. + ${ActiveDirectoryPropertyForestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the NetBIOS domain name. + ${ActiveDirectoryPropertyNetBiosDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory SAMAccountName for Azure Storage. + ${ActiveDirectoryPropertySamAccountName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow public access to all blobs or containers in the storage account. + # The default interpretation is true for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # The default interpretation is true for this property. + ${AllowCrossTenantReplication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. + # If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + # The default value is null, which is equivalent to true. + ${AllowSharedKeyAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope] + # Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + ${AllowedCopyScope}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission] + # Default share permission for users using Kerberos authentication if RBAC role is not assigned. + ${AzureFileIdentityBasedAuthenticationDefaultSharePermission}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions] + # Indicates the directory service used. + # Note that this enum may be extended in the future. + ${AzureFileIdentityBasedAuthenticationDirectoryServiceOption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Gets or sets the custom domain name assigned to the storage account. + # Name is the CNAME source. + ${CustomDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether indirect CName validation is enabled. + # Default value is false. + # This should only be set on updates. + ${CustomDomainUseSubDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether the default authentication is OAuth or not. + # The default interpretation is false for this property. + ${DefaultToOAuthAuthentication}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType] + # Allows you to specify the type of endpoint. + # Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + ${DnsEndpointType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows https traffic only to storage service if sets to true. + # The default value is true since API version 2019-04-01. + ${EnableHttpsTrafficOnly}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # NFS 3.0 protocol support enabled if set to true. + ${EnableNfsV3}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption] + # Encryption settings to be used for server-side encryption for the storage account. + # To construct, see NOTES section for ENCRYPTION properties and create a hash table. + ${Encryption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The name of the extended location. + ${ExtendedLocationName}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes] + # The type of the extended location. + ${ExtendedLocationType}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType] + # The identity type. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. + # The key is the ARM resource identifier of the identity. + # Only 1 User Assigned identity is permitted here. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for disabled and unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + ${ImmutabilityPolicyAllowProtectedAppendWrite}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState] + # The ImmutabilityPolicy state defines the mode of the policy. + # Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. + # A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. + # Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted. + ${ImmutabilityPolicyState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which enables account-level immutability. + # All the containers under such an account have object-level immutability enabled by default. + ${ImmutableStorageWithVersioningEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Account HierarchicalNamespace enabled if sets to true. + ${IsHnsEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables local users feature, if set to true + ${IsLocalUserEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables Secure File Transfer Protocol, if set to true + ${IsSftpEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The key expiration period in days. + ${KeyPolicyKeyExpirationPeriodInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState] + # Allow large file shares if sets to Enabled. + # It cannot be disabled once it is enabled. + ${LargeFileSharesState}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion] + # Set the minimum TLS version to be permitted on requests to storage. + # The default interpretation is TLS 1.0 for this property. + ${MinimumTlsVersion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass] + # Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + # Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + ${NetworkRuleSetBypass}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction] + # Specifies the default action of allow or deny when no other rules match. + ${NetworkRuleSetDefaultAction}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]] + # Sets the IP ACL rules + # To construct, see NOTES section for NETWORKRULESETIPRULE properties and create a hash table. + ${NetworkRuleSetIPRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]] + # Sets the resource access rules + # To construct, see NOTES section for NETWORKRULESETRESOURCEACCESSRULE properties and create a hash table. + ${NetworkRuleSetResourceAccessRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]] + # Sets the virtual network rules + # To construct, see NOTES section for NETWORKRULESETVIRTUALNETWORKRULE properties and create a hash table. + ${NetworkRuleSetVirtualNetworkRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess] + # Allow or disallow public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether internet routing storage endpoints are to be published + ${RoutingPreferencePublishInternetEndpoint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether microsoft routing storage endpoints are to be published + ${RoutingPreferencePublishMicrosoftEndpoint}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice] + # Routing Choice defines the kind of network routing opted by the user. + ${RoutingPreferenceRoutingChoice}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The SAS expiration period, DD.HH:MM:SS. + ${SasPolicySasExpirationPeriod}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the resource. + # These tags can be used for viewing and grouping this resource (across resource groups). + # A maximum of 15 tags can be provided for a resource. + # Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageAccount_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates or updates an unlocked immutability policy. +ETag in If-Match is honored if given but not required for this operation. +.Description +Creates or updates an unlocked immutability policy. +ETag in If-Match is honored if given but not required for this operation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobcontainerimmutabilitypolicy +#> +function New-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + ${AllowProtectedAppendWrite}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for unlocked time-based retention policies. + # When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + # This property cannot be changed with ExtendImmutabilityPolicy API. + # The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + ${AllowProtectedAppendWritesAll}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageBlobContainerImmutabilityPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates a new container under the specified account as described by request body. +The container resource includes metadata and properties for that container. +It does not include a list of the blobs contained by the container. +.Description +Creates a new container under the specified account as described by request body. +The container resource includes metadata and properties for that container. +It does not include a list of the blobs contained by the container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CONTAINERPROPERTY : Properties of the blob container. + [AllowProtectedAppendWrite ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + [AllowProtectedAppendWritesAll ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + [DefaultEncryptionScope ]: Default the container to use specified encryption scope for all writes. + [DenyEncryptionScopeOverride ]: Block override of encryption scope from the container default. + [EnableNfsV3AllSquash ]: Enable NFSv3 all squash on blob container. + [EnableNfsV3RootSquash ]: Enable NFSv3 root squash on blob container. + [ImmutabilityPeriodSinceCreationInDay ]: The immutability period for the blobs in the container since the policy creation, in days. + [ImmutableStorageWithVersioningEnabled ]: This is an immutable property, when set to true it enables object level immutability at the container level. + [LegalHoldTag ]: The list of LegalHold tags of a blob container. + [Metadata ]: A name-value pair to associate with the container as metadata. + [(Any) ]: This indicates any property can be added to this object. + [ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll ]: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + [PublicAccess ]: Specifies whether data in the container may be accessed publicly and the level of access. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobcontainer +#> +function New-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties] + # Properties of the blob container. + # To construct, see NOTES section for CONTAINERPROPERTY properties and create a hash table. + ${ContainerProperty}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageBlobContainer_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Sets the blob inventory policy to the specified storage account. +.Description +Sets the blob inventory policy to the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +POLICYRULE : The storage account blob inventory policy rules. The rule is applied when it is enabled. + DefinitionFormat : This is a required field, it specifies the format for the inventory files. + DefinitionObjectType : This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + DefinitionSchedule : This is a required field. This field is used to schedule an inventory formation. + DefinitionSchemaField : This is a required field. This field specifies the fields and properties of the object to be included in the inventory. The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts. + Destination : Container name where blob inventory files are stored. Must be pre-created. + Enabled : Rule is enabled when set to true. + Name : A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + [FilterBlobType ]: An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + [FilterExcludePrefix ]: An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + [FilterIncludeBlobVersion ]: Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, else they must be excluded. + [FilterIncludeDeleted ]: For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be excluded. + [FilterIncludeSnapshot ]: Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded. + [FilterPrefixMatch ]: An array of strings with maximum 10 blob prefixes to be included in the inventory. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageblobinventorypolicy +#> +function New-AzStorageBlobInventoryPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Policy is enabled if set to true. + ${PolicyEnabled}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]] + # The storage account blob inventory policy rules. + # The rule is applied when it is enabled. + # To construct, see NOTES section for POLICYRULE properties and create a hash table. + ${PolicyRule}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageBlobInventoryPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates a new share under the specified account as described by request body. +The share resource includes metadata and properties for that share. +It does not include a list of the files contained by the share. +.Description +Creates a new share under the specified account as described by request body. +The share resource includes metadata and properties for that share. +It does not include a list of the files contained by the share. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILESHAREPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the share. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: List of abbreviated permissions. + [AccessPolicyStartTime ]: Start time of the access policy + [Id ]: An unique identifier of the stored access policy. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragefileshare +#> +function New-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional, used to expand the properties within share's properties. + # Valid values are: snapshots. + # Should be passed as a string with delimiter ',' + ${Expand}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier] + # Access tier for specific share. + # GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + # FileStorage account can choose Premium. + ${FileSharePropertyAccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols] + # The authentication protocol that is used for the file share. + # Can only be specified when creating a share. + ${FileSharePropertyEnabledProtocol}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair to associate with the share as metadata. + ${FileSharePropertyMetadata}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType] + # The property is for NFS share only. + # The default is NoRootSquash. + ${FileSharePropertyRootSquash}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The maximum size of the share, in gigabytes. + # Must be greater than 0, and less than or equal to 5TB (5120). + # For Large File Shares, the maximum size is 102400. + ${FileSharePropertyShareQuota}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]] + # List of stored access policies specified on the share. + # To construct, see NOTES section for FILESHAREPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${FileSharePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageFileShare_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Regenerate the local user SSH password. +.Description +Regenerate the local user SSH password. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.String +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragelocaluserpassword +#> +function New-AzStorageLocalUserPassword { +[OutputType([System.String])] +[CmdletBinding(DefaultParameterSetName='Regenerate', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Regenerate')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Regenerate', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter(ParameterSetName='RegenerateViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Regenerate = 'Az.Storage.private\New-AzStorageLocalUserPassword_Regenerate'; + RegenerateViaIdentity = 'Az.Storage.private\New-AzStorageLocalUserPassword_RegenerateViaIdentity'; + } + if (('Regenerate') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create or update the properties of a local user associated with the storage account +.Description +Create or update the properties of a local user associated with the storage account +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +PERMISSIONSCOPE : The permission scopes of the local user. + Permission : The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c). + ResourceName : The name of resource, normally the container name or the file share name, used by the local user. + Service : The service used by the local user, e.g. blob, file. + +SSHAUTHORIZEDKEY : Optional, local user ssh authorized keys for SFTP. + [Description ]: Optional. It is used to store the function/usage of the key + [Key ]: Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragelocaluser +#> +function New-AzStorageLocalUser { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether shared key exists. + # Set it to false to remove existing shared key. + ${HasSharedKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether ssh key exists. + # Set it to false to remove existing SSH key. + ${HasSshKey}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether ssh password exists. + # Set it to false to remove existing SSH password. + ${HasSshPassword}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Optional, local user home directory. + ${HomeDirectory}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[]] + # The permission scopes of the local user. + # To construct, see NOTES section for PERMISSIONSCOPE properties and create a hash table. + ${PermissionScope}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]] + # Optional, local user ssh authorized keys for SFTP. + # To construct, see NOTES section for SSHAUTHORIZEDKEY properties and create a hash table. + ${SshAuthorizedKey}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageLocalUser_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Sets the managementpolicy to the specified storage account. +.Description +Sets the managementpolicy to the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +POLICYRULE : The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + DefinitionAction : An object that defines the action set. + [BaseBlobDeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [BaseBlobDeleteDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + [BaseBlobEnableAutoTierToHotFromCool ]: This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + [BaseBlobTierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + [BaseBlobTierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after blob creation. + [BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied. + [DeleteDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [DeleteDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [SnapshotDeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotDeleteDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [SnapshotTierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [SnapshotTierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [TierToArchiveDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToArchiveDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [TierToCoolDaysAfterLastAccessTimeGreaterThan ]: Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy + [TierToCoolDaysAfterModificationGreaterThan ]: Value indicating the age in days after last modification + [VersionDeleteDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionDeleteDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [VersionTierToArchiveDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToArchiveDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + [VersionTierToCoolDaysAfterCreationGreaterThan ]: Value indicating the age in days after creation + [VersionTierToCoolDaysAfterLastTierChangeGreaterThan ]: Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied. + Name : A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + [Enabled ]: Rule is enabled if set to true. + [FilterBlobIndexMatch ]: An array of blob index tag based filters, there can be at most 10 tag filters + Name : This is the filter tag name, it can have 1 - 128 characters + Op : This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported + Value : This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + [FilterBlobType ]: An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are supported for appendBlob. + [FilterPrefixMatch ]: An array of strings for prefixes to be match. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragemanagementpolicy +#> +function New-AzStorageManagementPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]] + # The Storage Account ManagementPolicies Rules. + # See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + # To construct, see NOTES section for POLICYRULE properties and create a hash table. + ${PolicyRule}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageManagementPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Create or update the object replication policy of the storage account. +.Description +Create or update the object replication policy of the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +RULE : The storage account object replication rules. + DestinationContainer : Required. Destination container name. + SourceContainer : Required. Source container name. + [FilterMinCreationTime ]: Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z + [FilterPrefixMatch ]: Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + [RuleId ]: Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstorageobjectreplicationpolicy +#> +function New-AzStorageObjectReplicationPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Alias('ObjectReplicationPolicyId')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # For the destination account, provide the value 'default'. + # Configure the policy on the destination account first. + # For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. + # The policy is downloaded as a JSON file. + ${Id}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Destination account name. + # It should be full resource id if allowCrossTenantReplication set to false. + ${DestinationAccount}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[]] + # The storage account object replication rules. + # To construct, see NOTES section for RULE properties and create a hash table. + ${Rule}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Source account name. + # It should be full resource id if allowCrossTenantReplication set to false. + ${SourceAccount}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageObjectReplicationPolicy_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates a new queue with the specified queue name, under the specified account. +.Description +Creates a new queue with the specified queue name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragequeue +#> +function New-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair that represents queue metadata. + ${QueuePropertyMetadata}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageQueue_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates a new table with the specified table name, under the specified account. +.Description +Creates a new table with the specified table name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +TABLEPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the table. + Id : unique-64-character-value of the stored access policy. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + [AccessPolicyStartTime ]: Start time of the access policy +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/new-azstoragetable +#> +function New-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable])] +[CmdletBinding(DefaultParameterSetName='CreateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]] + # List of stored access policies specified on the table. + # To construct, see NOTES section for TABLEPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${TablePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + CreateExpanded = 'Az.Storage.private\New-AzStorageTable_CreateExpanded'; + } + if (('CreateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes a storage account in Microsoft Azure. +.Description +Deletes a storage account in Microsoft Azure. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageaccount +#> +function Remove-AzStorageAccount { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageAccount_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageAccount_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Aborts an unlocked immutability policy. +The response of delete has immutabilityPeriodSinceCreationInDays set to 0. +ETag in If-Match is required for this operation. +Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. +.Description +Aborts an unlocked immutability policy. +The response of delete has immutabilityPeriodSinceCreationInDays set to 0. +ETag in If-Match is required for this operation. +Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobcontainerimmutabilitypolicy +#> +function Remove-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageBlobContainerImmutabilityPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes specified container under its account. +.Description +Deletes specified container under its account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobcontainer +#> +function Remove-AzStorageBlobContainer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageBlobContainer_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageBlobContainer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the blob inventory policy associated with the specified storage account. +.Description +Deletes the blob inventory policy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobinventorypolicy +#> +function Remove-AzStorageBlobInventoryPolicy { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageBlobInventoryPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageBlobInventoryPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes specified share under its account. +.Description +Deletes specified share under its account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragefileshare +#> +function Remove-AzStorageFileShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # Valid values are: snapshots, leased-snapshots, none. + # The default value is snapshots. + # For 'snapshots', the file share is deleted including all of its file share snapshots. + # If the file share contains leased-snapshots, the deletion fails. + # For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). + # For 'none', the file share is deleted if it has no share snapshots. + # If the file share contains any snapshots (leased or unleased), the deletion fails. + ${Include}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # Optional, used to delete a snapshot. + ${XmsSnapshot}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageFileShare_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageFileShare_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the local user associated with the specified storage account. +.Description +Deletes the local user associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragelocaluser +#> +function Remove-AzStorageLocalUser { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageLocalUser_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageLocalUser_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the managementpolicy associated with the specified storage account. +.Description +Deletes the managementpolicy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragemanagementpolicy +#> +function Remove-AzStorageManagementPolicy { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageManagementPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageManagementPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the object replication policy associated with the specified storage account. +.Description +Deletes the object replication policy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageobjectreplicationpolicy +#> +function Remove-AzStorageObjectReplicationPolicy { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ObjectReplicationPolicyId')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # For the destination account, provide the value 'default'. + # Configure the policy on the destination account first. + # For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. + # The policy is downloaded as a JSON file. + ${Id}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageObjectReplicationPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageObjectReplicationPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the specified private endpoint connection associated with the storage account. +.Description +Deletes the specified private endpoint connection associated with the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageprivateendpointconnection +#> +function Remove-AzStoragePrivateEndpointConnection { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the private endpoint connection associated with the Azure resource + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStoragePrivateEndpointConnection_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStoragePrivateEndpointConnection_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the queue with the specified queue name, under the specified account if it exists. +.Description +Deletes the queue with the specified queue name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragequeue +#> +function Remove-AzStorageQueue { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageQueue_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageQueue_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Deletes the table with the specified table name, under the specified account if it exists. +.Description +Deletes the table with the specified table name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragetable +#> +function Remove-AzStorageTable { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageTable_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageTable_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Restore blobs in the specified blob ranges +.Description +Restore blobs in the specified blob ranges +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BLOBRANGE : Blob ranges to restore. + EndRange : Blob end range. This is exclusive. Empty means account end. + StartRange : Blob start range. This is inclusive. Empty means account start. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : Blob restore parameters + BlobRange : Blob ranges to restore. + EndRange : Blob end range. This is exclusive. Empty means account end. + StartRange : Blob start range. This is inclusive. Empty means account start. + TimeToRestore : Restore blob to the specified time. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/restore-azstorageaccountblobrange +#> +function Restore-AzStorageAccountBlobRange { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus])] +[CmdletBinding(DefaultParameterSetName='RestoreViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Restore')] + [Parameter(ParameterSetName='RestoreExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Restore', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters] + # Blob restore parameters + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]] + # Blob ranges to restore. + # To construct, see NOTES section for BLOBRANGE properties and create a hash table. + ${BlobRange}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # Restore blob to the specified time. + ${TimeToRestore}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Restore = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_Restore'; + RestoreExpanded = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_RestoreExpanded'; + RestoreViaIdentity = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_RestoreViaIdentity'; + RestoreViaIdentityExpanded = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_RestoreViaIdentityExpanded'; + } + if (('Restore', 'RestoreExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Restore a file share within a valid retention days if share soft delete is enabled +.Description +Restore a file share within a valid retention days if share soft delete is enabled +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DELETEDSHARE : The deleted share to be restored. + Name : Required. Identify the name of the deleted share that will be restored. + Version : Required. Identify the version of the deleted share that will be restored. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/restore-azstoragefileshare +#> +function Restore-AzStorageFileShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='RestoreExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Restore')] + [Parameter(ParameterSetName='RestoreExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Restore', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare] + # The deleted share to be restored. + # To construct, see NOTES section for DELETEDSHARE properties and create a hash table. + ${DeletedShare}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Identify the name of the deleted share that will be restored. + ${DeletedShareName}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Identify the version of the deleted share that will be restored. + ${DeletedShareVersion}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Restore = 'Az.Storage.private\Restore-AzStorageFileShare_Restore'; + RestoreExpanded = 'Az.Storage.private\Restore-AzStorageFileShare_RestoreExpanded'; + RestoreViaIdentity = 'Az.Storage.private\Restore-AzStorageFileShare_RestoreViaIdentity'; + RestoreViaIdentityExpanded = 'Az.Storage.private\Restore-AzStorageFileShare_RestoreViaIdentityExpanded'; + } + if (('Restore', 'RestoreExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Revoke user delegation keys. +.Description +Revoke user delegation keys. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/revoke-azstorageaccountuserdelegationkey +#> +function Revoke-AzStorageAccountUserDelegationKey { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Revoke', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Revoke', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Revoke', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Revoke')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RevokeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Revoke = 'Az.Storage.private\Revoke-AzStorageAccountUserDelegationKey_Revoke'; + RevokeViaIdentity = 'Az.Storage.private\Revoke-AzStorageAccountUserDelegationKey_RevokeViaIdentity'; + } + if (('Revoke') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Checks that the storage account name is valid and is not already in use. +.Description +Checks that the storage account name is valid and is not already in use. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ACCOUNTNAME : The parameters used to check the availability of the storage account name. + Name : The storage account name. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/test-azstorageaccountnameavailability +#> +function Test-AzStorageAccountNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters] + # The parameters used to check the availability of the storage account name. + # To construct, see NOTES section for ACCOUNTNAME properties and create a hash table. + ${AccountName}, + + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The storage account name. + ${Name}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_Check'; + CheckExpanded = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_CheckExpanded'; + CheckViaIdentity = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +It can also be used to map the account to a custom domain. +Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. +In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. +The update of multiple properties is supported. +This call does not change the storage keys for the account. +If you want to change the storage account keys, use the regenerate keys operation. +The location and name of the storage account cannot be changed after creation. +.Description +The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +It can also be used to map the account to a custom domain. +Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. +In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. +The update of multiple properties is supported. +This call does not change the storage keys for the account. +If you want to change the storage account keys, use the regenerate keys operation. +The location and name of the storage account cannot be changed after creation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ENCRYPTION : Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + [BlobEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [BlobKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [FileEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [FileKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [IdentityEncryptionFederatedIdentityClientId ]: ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. + [IdentityEncryptionUserAssignedIdentity ]: Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + [KeySource ]: The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + [KeyVaultPropertyKeyName ]: The name of KeyVault key. + [KeyVaultPropertyKeyVaultUri ]: The Uri of KeyVault. + [KeyVaultPropertyKeyVersion ]: The version of KeyVault key. + [QueueEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [QueueKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [RequireInfrastructureEncryption ]: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + [TableEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [TableKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +NETWORKRULESETIPRULE : Sets the IP ACL rules + IPAddressOrRange : Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + [Action ]: The action of IP ACL rule. + +NETWORKRULESETRESOURCEACCESSRULE : Sets the resource access rules + [ResourceId ]: Resource Id + [TenantId ]: Tenant Id + +NETWORKRULESETVIRTUALNETWORKRULE : Sets the virtual network rules + VirtualNetworkResourceId : Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + [Action ]: The action of virtual network rule. + [State ]: Gets the state of virtual network rule. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageaccount +#> +function Update-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier] + # Required for storage accounts where kind = BlobStorage. + # The access tier is used for billing. + # The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. + ${AccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType] + # Specifies the Active Directory account type for Azure Storage. + ${ActiveDirectoryPropertyAccountType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID) for Azure Storage. + ${ActiveDirectoryPropertyAzureStorageSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the domain GUID. + ${ActiveDirectoryPropertyDomainGuid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the primary domain that the AD DNS server is authoritative for. + ${ActiveDirectoryPropertyDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID). + ${ActiveDirectoryPropertyDomainSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory forest to get. + ${ActiveDirectoryPropertyForestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the NetBIOS domain name. + ${ActiveDirectoryPropertyNetBiosDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory SAMAccountName for Azure Storage. + ${ActiveDirectoryPropertySamAccountName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow public access to all blobs or containers in the storage account. + # The default interpretation is true for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # The default interpretation is true for this property. + ${AllowCrossTenantReplication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. + # If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + # The default value is null, which is equivalent to true. + ${AllowSharedKeyAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope] + # Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + ${AllowedCopyScope}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission] + # Default share permission for users using Kerberos authentication if RBAC role is not assigned. + ${AzureFileIdentityBasedAuthenticationDefaultSharePermission}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions] + # Indicates the directory service used. + # Note that this enum may be extended in the future. + ${AzureFileIdentityBasedAuthenticationDirectoryServiceOption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Gets or sets the custom domain name assigned to the storage account. + # Name is the CNAME source. + ${CustomDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether indirect CName validation is enabled. + # Default value is false. + # This should only be set on updates. + ${CustomDomainUseSubDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether the default authentication is OAuth or not. + # The default interpretation is false for this property. + ${DefaultToOAuthAuthentication}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType] + # Allows you to specify the type of endpoint. + # Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + ${DnsEndpointType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows https traffic only to storage service if sets to true. + ${EnableHttpsTrafficOnly}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption] + # Not applicable. + # Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + # To construct, see NOTES section for ENCRYPTION properties and create a hash table. + ${Encryption}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType] + # The identity type. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. + # The key is the ARM resource identifier of the identity. + # Only 1 User Assigned identity is permitted here. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for disabled and unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + ${ImmutabilityPolicyAllowProtectedAppendWrite}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState] + # The ImmutabilityPolicy state defines the mode of the policy. + # Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. + # A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. + # Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted. + ${ImmutabilityPolicyState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which enables account-level immutability. + # All the containers under such an account have object-level immutability enabled by default. + ${ImmutableStorageWithVersioningEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables local users feature, if set to true + ${IsLocalUserEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables Secure File Transfer Protocol, if set to true + ${IsSftpEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The key expiration period in days. + ${KeyPolicyKeyExpirationPeriodInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind] + # Optional. + # Indicates the type of storage account. + # Currently only StorageV2 value supported by server. + ${Kind}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState] + # Allow large file shares if sets to Enabled. + # It cannot be disabled once it is enabled. + ${LargeFileSharesState}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion] + # Set the minimum TLS version to be permitted on requests to storage. + # The default interpretation is TLS 1.0 for this property. + ${MinimumTlsVersion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass] + # Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + # Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + ${NetworkRuleSetBypass}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction] + # Specifies the default action of allow or deny when no other rules match. + ${NetworkRuleSetDefaultAction}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]] + # Sets the IP ACL rules + # To construct, see NOTES section for NETWORKRULESETIPRULE properties and create a hash table. + ${NetworkRuleSetIPRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]] + # Sets the resource access rules + # To construct, see NOTES section for NETWORKRULESETRESOURCEACCESSRULE properties and create a hash table. + ${NetworkRuleSetResourceAccessRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]] + # Sets the virtual network rules + # To construct, see NOTES section for NETWORKRULESETVIRTUALNETWORKRULE properties and create a hash table. + ${NetworkRuleSetVirtualNetworkRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess] + # Allow or disallow public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether internet routing storage endpoints are to be published + ${RoutingPreferencePublishInternetEndpoint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether microsoft routing storage endpoints are to be published + ${RoutingPreferencePublishMicrosoftEndpoint}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice] + # Routing Choice defines the kind of network routing opted by the user. + ${RoutingPreferenceRoutingChoice}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The SAS expiration period, DD.HH:MM:SS. + ${SasPolicySasExpirationPeriod}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName] + # The SKU name. + # Required for account creation; optional for update. + # Note that in older versions, SKU name was called accountType. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the resource. + # These tags can be used in viewing and grouping this resource (across resource groups). + # A maximum of 15 tags can be provided for a resource. + # Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageAccount_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageAccount_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates container properties as specified in request body. +Properties not mentioned in the request will be unchanged. +Update fails if the specified container doesn't already exist. +.Description +Updates container properties as specified in request body. +Properties not mentioned in the request will be unchanged. +Update fails if the specified container doesn't already exist. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CONTAINERPROPERTY : Properties of the blob container. + [AllowProtectedAppendWrite ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + [AllowProtectedAppendWritesAll ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + [DefaultEncryptionScope ]: Default the container to use specified encryption scope for all writes. + [DenyEncryptionScopeOverride ]: Block override of encryption scope from the container default. + [EnableNfsV3AllSquash ]: Enable NFSv3 all squash on blob container. + [EnableNfsV3RootSquash ]: Enable NFSv3 root squash on blob container. + [ImmutabilityPeriodSinceCreationInDay ]: The immutability period for the blobs in the container since the policy creation, in days. + [ImmutableStorageWithVersioningEnabled ]: This is an immutable property, when set to true it enables object level immutability at the container level. + [LegalHoldTag ]: The list of LegalHold tags of a blob container. + [Metadata ]: A name-value pair to associate with the container as metadata. + [(Any) ]: This indicates any property can be added to this object. + [ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll ]: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + [PublicAccess ]: Specifies whether data in the container may be accessed publicly and the level of access. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageblobcontainer +#> +function Update-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties] + # Properties of the blob container. + # To construct, see NOTES section for CONTAINERPROPERTY properties and create a hash table. + ${ContainerProperty}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageBlobContainer_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageBlobContainer_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Update encryption scope properties as specified in the request body. +Update fails if the specified encryption scope does not already exist. +.Description +Update encryption scope properties as specified in the request body. +Update fails if the specified encryption scope does not already exist. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ENCRYPTIONSCOPE : The Encryption Scope resource. + [KeyVaultPropertyKeyUri ]: The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + [PropertyRequireInfrastructureEncryption ]: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + [PropertySource ]: The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + [PropertyState ]: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageencryptionscope +#> +function Update-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope])] +[CmdletBinding(DefaultParameterSetName='PatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Alias('EncryptionScopeName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the encryption scope within the specified storage account. + # Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${Name}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Patch')] + [Parameter(ParameterSetName='PatchExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Patch', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope] + # The Encryption Scope resource. + # To construct, see NOTES section for ENCRYPTIONSCOPE properties and create a hash table. + ${EncryptionScope}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + ${EncryptionScopePropertyRequireInfrastructureEncryption}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource] + # The provider for the encryption scope. + # Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + ${EncryptionScopePropertySource}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState] + # The state of the encryption scope. + # Possible values (case-insensitive): Enabled, Disabled. + ${EncryptionScopePropertyState}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The object identifier for a key vault key object. + # When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + ${KeyVaultPropertyKeyUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Patch = 'Az.Storage.private\Update-AzStorageEncryptionScope_Patch'; + PatchExpanded = 'Az.Storage.private\Update-AzStorageEncryptionScope_PatchExpanded'; + PatchViaIdentity = 'Az.Storage.private\Update-AzStorageEncryptionScope_PatchViaIdentity'; + PatchViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageEncryptionScope_PatchViaIdentityExpanded'; + } + if (('Patch', 'PatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Updates share properties as specified in request body. +Properties not mentioned in the request will not be changed. +Update fails if the specified share does not already exist. +.Description +Updates share properties as specified in request body. +Properties not mentioned in the request will not be changed. +Update fails if the specified share does not already exist. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILESHAREPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the share. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: List of abbreviated permissions. + [AccessPolicyStartTime ]: Start time of the access policy + [Id ]: An unique identifier of the stored access policy. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragefileshare +#> +function Update-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier] + # Access tier for specific share. + # GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + # FileStorage account can choose Premium. + ${FileSharePropertyAccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols] + # The authentication protocol that is used for the file share. + # Can only be specified when creating a share. + ${FileSharePropertyEnabledProtocol}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair to associate with the share as metadata. + ${FileSharePropertyMetadata}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType] + # The property is for NFS share only. + # The default is NoRootSquash. + ${FileSharePropertyRootSquash}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The maximum size of the share, in gigabytes. + # Must be greater than 0, and less than or equal to 5TB (5120). + # For Large File Shares, the maximum size is 102400. + ${FileSharePropertyShareQuota}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]] + # List of stored access policies specified on the share. + # To construct, see NOTES section for FILESHAREPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${FileSharePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageFileShare_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageFileShare_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates a new queue with the specified queue name, under the specified account. +.Description +Creates a new queue with the specified queue name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragequeue +#> +function Update-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair that represents queue metadata. + ${QueuePropertyMetadata}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageQueue_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageQueue_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} + +<# +.Synopsis +Creates a new table with the specified table name, under the specified account. +.Description +Creates a new table with the specified table name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +TABLEPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the table. + Id : unique-64-character-value of the stored access policy. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + [AccessPolicyStartTime ]: Start time of the access policy +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragetable +#> +function Update-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]] + # List of stored access policies specified on the table. + # To construct, see NOTES section for TABLEPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${TablePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageTable_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageTable_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/README.md b/swaggerci/storage/exports/README.md new file mode 100644 index 000000000000..15e1613af487 --- /dev/null +++ b/swaggerci/storage/exports/README.md @@ -0,0 +1,20 @@ +# Exports +This directory contains the cmdlets *exported by* `Az.Storage`. No other cmdlets in this repository are directly exported. What that means is the `Az.Storage` module will run [Export-ModuleMember](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/export-modulemember) on the cmldets in this directory. The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The cmdlets generated here are created every time you run `build-module.ps1`. These cmdlets are a merge of all (excluding `InternalExport`) cmdlets from the private binary (`../bin/Az.Storage.private.dll`) and from the `../custom/Az.Storage.custom.psm1` module. Cmdlets that are *not merged* from those directories are decorated with the `InternalExport` attribute. This happens when you set the cmdlet to **hide** from configuration. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) or the [README.md](../internal/README.md) in the `../internal` folder. + +## Purpose +We generate script cmdlets out of the binary cmdlets and custom cmdlets. The format of script cmdlets are simplistic; thus, easier to generate at build time. Generating the cmdlets is required as to allow merging of generated binary, hand-written binary, and hand-written custom cmdlets. For Azure cmdlets, having script cmdlets simplifies the mechanism for exporting Azure profiles. + +## Structure +The cmdlets generated here will flat in the directory (no sub-folders) as long as there are no Azure profiles specified for any cmdlets. Azure profiles (the `Profiles` attribute) is only applied when generating with the `--azure` attribute (or `azure: true` in the configuration). When Azure profiles are applied, the folder structure has a folder per profile. Each profile folder has only those cmdlets that apply to that profile. + +## Usage +When `./Az.Storage.psm1` is loaded, it dynamically exports cmdlets here based on the folder structure and on the selected profile. If there are no sub-folders, it exports all cmdlets at the root of this folder. If there are sub-folders, it checks to see the selected profile. If no profile is selected, it exports the cmdlets in the last sub-folder (alphabetically). If a profile is selected, it exports the cmdlets in the sub-folder that matches the profile name. If there is no sub-folder that matches the profile name, it exports no cmdlets and writes a warning message. \ No newline at end of file diff --git a/swaggerci/storage/exports/Remove-AzStorageAccount.ps1 b/swaggerci/storage/exports/Remove-AzStorageAccount.ps1 new file mode 100644 index 000000000000..a6fe924505f4 --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageAccount.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes a storage account in Microsoft Azure. +.Description +Deletes a storage account in Microsoft Azure. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageaccount +#> +function Remove-AzStorageAccount { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageAccount_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageAccount_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageBlobContainer.ps1 b/swaggerci/storage/exports/Remove-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..3798e105e029 --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageBlobContainer.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes specified container under its account. +.Description +Deletes specified container under its account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobcontainer +#> +function Remove-AzStorageBlobContainer { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageBlobContainer_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageBlobContainer_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageBlobContainerImmutabilityPolicy.ps1 b/swaggerci/storage/exports/Remove-AzStorageBlobContainerImmutabilityPolicy.ps1 new file mode 100644 index 000000000000..335835cde4f5 --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageBlobContainerImmutabilityPolicy.ps1 @@ -0,0 +1,231 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Aborts an unlocked immutability policy. +The response of delete has immutabilityPeriodSinceCreationInDays set to 0. +ETag in If-Match is required for this operation. +Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. +.Description +Aborts an unlocked immutability policy. +The response of delete has immutabilityPeriodSinceCreationInDays set to 0. +ETag in If-Match is required for this operation. +Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobcontainerimmutabilitypolicy +#> +function Remove-AzStorageBlobContainerImmutabilityPolicy { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # The entity state (ETag) version of the immutability policy to update. + # A value of "*" can be used to apply the operation only if the immutability policy already exists. + # If omitted, this operation will always be applied. + ${IfMatch}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageBlobContainerImmutabilityPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageBlobInventoryPolicy.ps1 b/swaggerci/storage/exports/Remove-AzStorageBlobInventoryPolicy.ps1 new file mode 100644 index 000000000000..ca39d93d2bbb --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageBlobInventoryPolicy.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the blob inventory policy associated with the specified storage account. +.Description +Deletes the blob inventory policy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageblobinventorypolicy +#> +function Remove-AzStorageBlobInventoryPolicy { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageBlobInventoryPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageBlobInventoryPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageFileShare.ps1 b/swaggerci/storage/exports/Remove-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..5d3c09da8ece --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageFileShare.ps1 @@ -0,0 +1,242 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes specified share under its account. +.Description +Deletes specified share under its account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragefileshare +#> +function Remove-AzStorageFileShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Query')] + [System.String] + # Optional. + # Valid values are: snapshots, leased-snapshots, none. + # The default value is snapshots. + # For 'snapshots', the file share is deleted including all of its file share snapshots. + # If the file share contains leased-snapshots, the deletion fails. + # For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). + # For 'none', the file share is deleted if it has no share snapshots. + # If the file share contains any snapshots (leased or unleased), the deletion fails. + ${Include}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Header')] + [System.String] + # Optional, used to delete a snapshot. + ${XmsSnapshot}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageFileShare_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageFileShare_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageLocalUser.ps1 b/swaggerci/storage/exports/Remove-AzStorageLocalUser.ps1 new file mode 100644 index 000000000000..8d37d005e1e9 --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageLocalUser.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the local user associated with the specified storage account. +.Description +Deletes the local user associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragelocaluser +#> +function Remove-AzStorageLocalUser { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of local user. + # The username must contain lowercase letters and numbers only. + # It must be unique only within the storage account. + ${Username}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageLocalUser_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageLocalUser_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageManagementPolicy.ps1 b/swaggerci/storage/exports/Remove-AzStorageManagementPolicy.ps1 new file mode 100644 index 000000000000..8ba258bb7035 --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageManagementPolicy.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the managementpolicy associated with the specified storage account. +.Description +Deletes the managementpolicy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragemanagementpolicy +#> +function Remove-AzStorageManagementPolicy { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageManagementPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageManagementPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageObjectReplicationPolicy.ps1 b/swaggerci/storage/exports/Remove-AzStorageObjectReplicationPolicy.ps1 new file mode 100644 index 000000000000..a961fe674cbf --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageObjectReplicationPolicy.ps1 @@ -0,0 +1,225 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the object replication policy associated with the specified storage account. +.Description +Deletes the object replication policy associated with the specified storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageobjectreplicationpolicy +#> +function Remove-AzStorageObjectReplicationPolicy { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('ObjectReplicationPolicyId')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # For the destination account, provide the value 'default'. + # Configure the policy on the destination account first. + # For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. + # The policy is downloaded as a JSON file. + ${Id}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageObjectReplicationPolicy_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageObjectReplicationPolicy_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStoragePrivateEndpointConnection.ps1 b/swaggerci/storage/exports/Remove-AzStoragePrivateEndpointConnection.ps1 new file mode 100644 index 000000000000..2f60688411c6 --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStoragePrivateEndpointConnection.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the specified private endpoint connection associated with the storage account. +.Description +Deletes the specified private endpoint connection associated with the storage account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstorageprivateendpointconnection +#> +function Remove-AzStoragePrivateEndpointConnection { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('PrivateEndpointConnectionName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the private endpoint connection associated with the Azure resource + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStoragePrivateEndpointConnection_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStoragePrivateEndpointConnection_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageQueue.ps1 b/swaggerci/storage/exports/Remove-AzStorageQueue.ps1 new file mode 100644 index 000000000000..e4c105027570 --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageQueue.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the queue with the specified queue name, under the specified account if it exists. +.Description +Deletes the queue with the specified queue name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragequeue +#> +function Remove-AzStorageQueue { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageQueue_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageQueue_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Remove-AzStorageTable.ps1 b/swaggerci/storage/exports/Remove-AzStorageTable.ps1 new file mode 100644 index 000000000000..90235fee4a1d --- /dev/null +++ b/swaggerci/storage/exports/Remove-AzStorageTable.ps1 @@ -0,0 +1,222 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Deletes the table with the specified table name, under the specified account if it exists. +.Description +Deletes the table with the specified table name, under the specified account if it exists. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/remove-azstoragetable +#> +function Remove-AzStorageTable { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Delete', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(ParameterSetName='Delete', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Delete')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='DeleteViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Delete = 'Az.Storage.private\Remove-AzStorageTable_Delete'; + DeleteViaIdentity = 'Az.Storage.private\Remove-AzStorageTable_DeleteViaIdentity'; + } + if (('Delete') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Restore-AzStorageAccountBlobRange.ps1 b/swaggerci/storage/exports/Restore-AzStorageAccountBlobRange.ps1 new file mode 100644 index 000000000000..1ce9ca90d62a --- /dev/null +++ b/swaggerci/storage/exports/Restore-AzStorageAccountBlobRange.ps1 @@ -0,0 +1,263 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Restore blobs in the specified blob ranges +.Description +Restore blobs in the specified blob ranges +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +BLOBRANGE : Blob ranges to restore. + EndRange : Blob end range. This is exclusive. Empty means account end. + StartRange : Blob start range. This is inclusive. Empty means account start. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +PARAMETER : Blob restore parameters + BlobRange : Blob ranges to restore. + EndRange : Blob end range. This is exclusive. Empty means account end. + StartRange : Blob start range. This is inclusive. Empty means account start. + TimeToRestore : Restore blob to the specified time. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/restore-azstorageaccountblobrange +#> +function Restore-AzStorageAccountBlobRange { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus])] +[CmdletBinding(DefaultParameterSetName='RestoreViaIdentity', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Restore')] + [Parameter(ParameterSetName='RestoreExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Restore', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters] + # Blob restore parameters + # To construct, see NOTES section for PARAMETER properties and create a hash table. + ${Parameter}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]] + # Blob ranges to restore. + # To construct, see NOTES section for BLOBRANGE properties and create a hash table. + ${BlobRange}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.DateTime] + # Restore blob to the specified time. + ${TimeToRestore}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command as a job + ${AsJob}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Run the command asynchronously + ${NoWait}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Restore = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_Restore'; + RestoreExpanded = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_RestoreExpanded'; + RestoreViaIdentity = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_RestoreViaIdentity'; + RestoreViaIdentityExpanded = 'Az.Storage.private\Restore-AzStorageAccountBlobRange_RestoreViaIdentityExpanded'; + } + if (('Restore', 'RestoreExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Restore-AzStorageFileShare.ps1 b/swaggerci/storage/exports/Restore-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..f748a10c81c9 --- /dev/null +++ b/swaggerci/storage/exports/Restore-AzStorageFileShare.ps1 @@ -0,0 +1,260 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Restore a file share within a valid retention days if share soft delete is enabled +.Description +Restore a file share within a valid retention days if share soft delete is enabled +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +DELETEDSHARE : The deleted share to be restored. + Name : Required. Identify the name of the deleted share that will be restored. + Version : Required. Identify the version of the deleted share that will be restored. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/restore-azstoragefileshare +#> +function Restore-AzStorageFileShare { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='RestoreExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Restore', Mandatory)] + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='Restore')] + [Parameter(ParameterSetName='RestoreExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Restore', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='RestoreViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare] + # The deleted share to be restored. + # To construct, see NOTES section for DELETEDSHARE properties and create a hash table. + ${DeletedShare}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Identify the name of the deleted share that will be restored. + ${DeletedShareName}, + + [Parameter(ParameterSetName='RestoreExpanded', Mandatory)] + [Parameter(ParameterSetName='RestoreViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Required. + # Identify the version of the deleted share that will be restored. + ${DeletedShareVersion}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Restore = 'Az.Storage.private\Restore-AzStorageFileShare_Restore'; + RestoreExpanded = 'Az.Storage.private\Restore-AzStorageFileShare_RestoreExpanded'; + RestoreViaIdentity = 'Az.Storage.private\Restore-AzStorageFileShare_RestoreViaIdentity'; + RestoreViaIdentityExpanded = 'Az.Storage.private\Restore-AzStorageFileShare_RestoreViaIdentityExpanded'; + } + if (('Restore', 'RestoreExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Revoke-AzStorageAccountUserDelegationKey.ps1 b/swaggerci/storage/exports/Revoke-AzStorageAccountUserDelegationKey.ps1 new file mode 100644 index 000000000000..832638c1cf17 --- /dev/null +++ b/swaggerci/storage/exports/Revoke-AzStorageAccountUserDelegationKey.ps1 @@ -0,0 +1,215 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Revoke user delegation keys. +.Description +Revoke user delegation keys. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +System.Boolean +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/revoke-azstorageaccountuserdelegationkey +#> +function Revoke-AzStorageAccountUserDelegationKey { +[OutputType([System.Boolean])] +[CmdletBinding(DefaultParameterSetName='Revoke', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Revoke', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Revoke', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Revoke')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='RevokeViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Returns true when the command succeeds + ${PassThru}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Revoke = 'Az.Storage.private\Revoke-AzStorageAccountUserDelegationKey_Revoke'; + RevokeViaIdentity = 'Az.Storage.private\Revoke-AzStorageAccountUserDelegationKey_RevokeViaIdentity'; + } + if (('Revoke') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Test-AzStorageAccountNameAvailability.ps1 b/swaggerci/storage/exports/Test-AzStorageAccountNameAvailability.ps1 new file mode 100644 index 000000000000..03ce354ac20d --- /dev/null +++ b/swaggerci/storage/exports/Test-AzStorageAccountNameAvailability.ps1 @@ -0,0 +1,219 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Checks that the storage account name is valid and is not already in use. +.Description +Checks that the storage account name is valid and is not already in use. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ACCOUNTNAME : The parameters used to check the availability of the storage account name. + Name : The storage account name. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/test-azstorageaccountnameavailability +#> +function Test-AzStorageAccountNameAvailability { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult])] +[CmdletBinding(DefaultParameterSetName='CheckExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Check')] + [Parameter(ParameterSetName='CheckExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Check', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='CheckViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters] + # The parameters used to check the availability of the storage account name. + # To construct, see NOTES section for ACCOUNTNAME properties and create a hash table. + ${AccountName}, + + [Parameter(ParameterSetName='CheckExpanded', Mandatory)] + [Parameter(ParameterSetName='CheckViaIdentityExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The storage account name. + ${Name}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Check = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_Check'; + CheckExpanded = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_CheckExpanded'; + CheckViaIdentity = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_CheckViaIdentity'; + CheckViaIdentityExpanded = 'Az.Storage.private\Test-AzStorageAccountNameAvailability_CheckViaIdentityExpanded'; + } + if (('Check', 'CheckExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Update-AzStorageAccount.ps1 b/swaggerci/storage/exports/Update-AzStorageAccount.ps1 new file mode 100644 index 000000000000..369c38324746 --- /dev/null +++ b/swaggerci/storage/exports/Update-AzStorageAccount.ps1 @@ -0,0 +1,580 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +It can also be used to map the account to a custom domain. +Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. +In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. +The update of multiple properties is supported. +This call does not change the storage keys for the account. +If you want to change the storage account keys, use the regenerate keys operation. +The location and name of the storage account cannot be changed after creation. +.Description +The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. +It can also be used to map the account to a custom domain. +Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. +In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. +The update of multiple properties is supported. +This call does not change the storage keys for the account. +If you want to change the storage account keys, use the regenerate keys operation. +The location and name of the storage account cannot be changed after creation. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ENCRYPTION : Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + [BlobEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [BlobKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [FileEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [FileKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [IdentityEncryptionFederatedIdentityClientId ]: ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account. + [IdentityEncryptionUserAssignedIdentity ]: Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + [KeySource ]: The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + [KeyVaultPropertyKeyName ]: The name of KeyVault key. + [KeyVaultPropertyKeyVaultUri ]: The Uri of KeyVault. + [KeyVaultPropertyKeyVersion ]: The version of KeyVault key. + [QueueEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [QueueKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + [RequireInfrastructureEncryption ]: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + [TableEnabled ]: A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled. + [TableKeyType ]: Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +NETWORKRULESETIPRULE : Sets the IP ACL rules + IPAddressOrRange : Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + [Action ]: The action of IP ACL rule. + +NETWORKRULESETRESOURCEACCESSRULE : Sets the resource access rules + [ResourceId ]: Resource Id + [TenantId ]: Tenant Id + +NETWORKRULESETVIRTUALNETWORKRULE : Sets the virtual network rules + VirtualNetworkResourceId : Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + [Action ]: The action of virtual network rule. + [State ]: Gets the state of virtual network rule. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageaccount +#> +function Update-AzStorageAccount { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier] + # Required for storage accounts where kind = BlobStorage. + # The access tier is used for billing. + # The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type. + ${AccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType] + # Specifies the Active Directory account type for Azure Storage. + ${ActiveDirectoryPropertyAccountType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID) for Azure Storage. + ${ActiveDirectoryPropertyAzureStorageSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the domain GUID. + ${ActiveDirectoryPropertyDomainGuid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the primary domain that the AD DNS server is authoritative for. + ${ActiveDirectoryPropertyDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the security identifier (SID). + ${ActiveDirectoryPropertyDomainSid}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory forest to get. + ${ActiveDirectoryPropertyForestName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the NetBIOS domain name. + ${ActiveDirectoryPropertyNetBiosDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Specifies the Active Directory SAMAccountName for Azure Storage. + ${ActiveDirectoryPropertySamAccountName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow public access to all blobs or containers in the storage account. + # The default interpretation is true for this property. + ${AllowBlobPublicAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allow or disallow cross AAD tenant object replication. + # The default interpretation is true for this property. + ${AllowCrossTenantReplication}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. + # If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + # The default value is null, which is equivalent to true. + ${AllowSharedKeyAccess}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope] + # Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + ${AllowedCopyScope}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission] + # Default share permission for users using Kerberos authentication if RBAC role is not assigned. + ${AzureFileIdentityBasedAuthenticationDefaultSharePermission}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions] + # Indicates the directory service used. + # Note that this enum may be extended in the future. + ${AzureFileIdentityBasedAuthenticationDirectoryServiceOption}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # Gets or sets the custom domain name assigned to the storage account. + # Name is the CNAME source. + ${CustomDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Indicates whether indirect CName validation is enabled. + # Default value is false. + # This should only be set on updates. + ${CustomDomainUseSubDomainName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether the default authentication is OAuth or not. + # The default interpretation is false for this property. + ${DefaultToOAuthAuthentication}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType] + # Allows you to specify the type of endpoint. + # Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + ${DnsEndpointType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Allows https traffic only to storage service if sets to true. + ${EnableHttpsTrafficOnly}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption] + # Not applicable. + # Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + # To construct, see NOTES section for ENCRYPTION properties and create a hash table. + ${Encryption}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType] + # The identity type. + ${IdentityType}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. + # The key is the ARM resource identifier of the identity. + # Only 1 User Assigned identity is permitted here. + ${IdentityUserAssignedIdentity}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # This property can only be changed for disabled and unlocked time-based retention policies. + # When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. + # Only new blocks can be added and any existing blocks cannot be modified or deleted. + ${ImmutabilityPolicyAllowProtectedAppendWrite}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The immutability period for the blobs in the container since the policy creation, in days. + ${ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState] + # The ImmutabilityPolicy state defines the mode of the policy. + # Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. + # A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. + # Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted. + ${ImmutabilityPolicyState}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which enables account-level immutability. + # All the containers under such an account have object-level immutability enabled by default. + ${ImmutableStorageWithVersioningEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables local users feature, if set to true + ${IsLocalUserEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # Enables Secure File Transfer Protocol, if set to true + ${IsSftpEnabled}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The key expiration period in days. + ${KeyPolicyKeyExpirationPeriodInDay}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind] + # Optional. + # Indicates the type of storage account. + # Currently only StorageV2 value supported by server. + ${Kind}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState] + # Allow large file shares if sets to Enabled. + # It cannot be disabled once it is enabled. + ${LargeFileSharesState}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion] + # Set the minimum TLS version to be permitted on requests to storage. + # The default interpretation is TLS 1.0 for this property. + ${MinimumTlsVersion}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass] + # Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. + # Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. + ${NetworkRuleSetBypass}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction] + # Specifies the default action of allow or deny when no other rules match. + ${NetworkRuleSetDefaultAction}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]] + # Sets the IP ACL rules + # To construct, see NOTES section for NETWORKRULESETIPRULE properties and create a hash table. + ${NetworkRuleSetIPRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]] + # Sets the resource access rules + # To construct, see NOTES section for NETWORKRULESETRESOURCEACCESSRULE properties and create a hash table. + ${NetworkRuleSetResourceAccessRule}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]] + # Sets the virtual network rules + # To construct, see NOTES section for NETWORKRULESETVIRTUALNETWORKRULE properties and create a hash table. + ${NetworkRuleSetVirtualNetworkRule}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess] + # Allow or disallow public network access to Storage Account. + # Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + ${PublicNetworkAccess}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether internet routing storage endpoints are to be published + ${RoutingPreferencePublishInternetEndpoint}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean flag which indicates whether microsoft routing storage endpoints are to be published + ${RoutingPreferencePublishMicrosoftEndpoint}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice] + # Routing Choice defines the kind of network routing opted by the user. + ${RoutingPreferenceRoutingChoice}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The SAS expiration period, DD.HH:MM:SS. + ${SasPolicySasExpirationPeriod}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName] + # The SKU name. + # Required for account creation; optional for update. + # Note that in older versions, SKU name was called accountType. + ${SkuName}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags]))] + [System.Collections.Hashtable] + # Gets or sets a list of key value pairs that describe the resource. + # These tags can be used in viewing and grouping this resource (across resource groups). + # A maximum of 15 tags can be provided for a resource. + # Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + ${Tag}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageAccount_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageAccount_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Update-AzStorageBlobContainer.ps1 b/swaggerci/storage/exports/Update-AzStorageBlobContainer.ps1 new file mode 100644 index 000000000000..48e1a4732e76 --- /dev/null +++ b/swaggerci/storage/exports/Update-AzStorageBlobContainer.ps1 @@ -0,0 +1,243 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates container properties as specified in request body. +Properties not mentioned in the request will be unchanged. +Update fails if the specified container doesn't already exist. +.Description +Updates container properties as specified in request body. +Properties not mentioned in the request will be unchanged. +Update fails if the specified container doesn't already exist. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +CONTAINERPROPERTY : Properties of the blob container. + [AllowProtectedAppendWrite ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + [AllowProtectedAppendWritesAll ]: This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + [DefaultEncryptionScope ]: Default the container to use specified encryption scope for all writes. + [DenyEncryptionScopeOverride ]: Block override of encryption scope from the container default. + [EnableNfsV3AllSquash ]: Enable NFSv3 all squash on blob container. + [EnableNfsV3RootSquash ]: Enable NFSv3 root squash on blob container. + [ImmutabilityPeriodSinceCreationInDay ]: The immutability period for the blobs in the container since the policy creation, in days. + [ImmutableStorageWithVersioningEnabled ]: This is an immutable property, when set to true it enables object level immutability at the container level. + [LegalHoldTag ]: The list of LegalHold tags of a blob container. + [Metadata ]: A name-value pair to associate with the container as metadata. + [(Any) ]: This indicates any property can be added to this object. + [ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll ]: When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. + [PublicAccess ]: Specifies whether data in the container may be accessed publicly and the level of access. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageblobcontainer +#> +function Update-AzStorageBlobContainer { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the blob container within the specified storage account. + # Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ContainerName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties] + # Properties of the blob container. + # To construct, see NOTES section for CONTAINERPROPERTY properties and create a hash table. + ${ContainerProperty}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageBlobContainer_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageBlobContainer_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Update-AzStorageEncryptionScope.ps1 b/swaggerci/storage/exports/Update-AzStorageEncryptionScope.ps1 new file mode 100644 index 000000000000..b1cc06f28d2c --- /dev/null +++ b/swaggerci/storage/exports/Update-AzStorageEncryptionScope.ps1 @@ -0,0 +1,276 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Update encryption scope properties as specified in the request body. +Update fails if the specified encryption scope does not already exist. +.Description +Update encryption scope properties as specified in the request body. +Update fails if the specified encryption scope does not already exist. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +ENCRYPTIONSCOPE : The Encryption Scope resource. + [KeyVaultPropertyKeyUri ]: The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + [PropertyRequireInfrastructureEncryption ]: A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + [PropertySource ]: The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + [PropertyState ]: The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstorageencryptionscope +#> +function Update-AzStorageEncryptionScope { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope])] +[CmdletBinding(DefaultParameterSetName='PatchExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Alias('EncryptionScopeName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the encryption scope within the specified storage account. + # Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${Name}, + + [Parameter(ParameterSetName='Patch', Mandatory)] + [Parameter(ParameterSetName='PatchExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='Patch')] + [Parameter(ParameterSetName='PatchExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter(ParameterSetName='Patch', Mandatory, ValueFromPipeline)] + [Parameter(ParameterSetName='PatchViaIdentity', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope] + # The Encryption Scope resource. + # To construct, see NOTES section for ENCRYPTIONSCOPE properties and create a hash table. + ${EncryptionScope}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Management.Automation.SwitchParameter] + # A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + ${EncryptionScopePropertyRequireInfrastructureEncryption}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource] + # The provider for the encryption scope. + # Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + ${EncryptionScopePropertySource}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState] + # The state of the encryption scope. + # Possible values (case-insensitive): Enabled, Disabled. + ${EncryptionScopePropertyState}, + + [Parameter(ParameterSetName='PatchExpanded')] + [Parameter(ParameterSetName='PatchViaIdentityExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.String] + # The object identifier for a key vault key object. + # When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope. + ${KeyVaultPropertyKeyUri}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + Patch = 'Az.Storage.private\Update-AzStorageEncryptionScope_Patch'; + PatchExpanded = 'Az.Storage.private\Update-AzStorageEncryptionScope_PatchExpanded'; + PatchViaIdentity = 'Az.Storage.private\Update-AzStorageEncryptionScope_PatchViaIdentity'; + PatchViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageEncryptionScope_PatchViaIdentityExpanded'; + } + if (('Patch', 'PatchExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Update-AzStorageFileShare.ps1 b/swaggerci/storage/exports/Update-AzStorageFileShare.ps1 new file mode 100644 index 000000000000..2dfd754d0684 --- /dev/null +++ b/swaggerci/storage/exports/Update-AzStorageFileShare.ps1 @@ -0,0 +1,275 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Updates share properties as specified in request body. +Properties not mentioned in the request will not be changed. +Update fails if the specified share does not already exist. +.Description +Updates share properties as specified in request body. +Properties not mentioned in the request will not be changed. +Update fails if the specified share does not already exist. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +FILESHAREPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the share. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: List of abbreviated permissions. + [AccessPolicyStartTime ]: Start time of the access policy + [Id ]: An unique identifier of the stored access policy. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragefileshare +#> +function Update-AzStorageFileShare { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the file share within the specified storage account. + # File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. + # Every dash (-) character must be immediately preceded and followed by a letter or number. + ${ShareName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier] + # Access tier for specific share. + # GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. + # FileStorage account can choose Premium. + ${FileSharePropertyAccessTier}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols] + # The authentication protocol that is used for the file share. + # Can only be specified when creating a share. + ${FileSharePropertyEnabledProtocol}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair to associate with the share as metadata. + ${FileSharePropertyMetadata}, + + [Parameter()] + [ArgumentCompleter([Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType])] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType] + # The property is for NFS share only. + # The default is NoRootSquash. + ${FileSharePropertyRootSquash}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [System.Int32] + # The maximum size of the share, in gigabytes. + # Must be greater than 0, and less than or equal to 5TB (5120). + # For Large File Shares, the maximum size is 102400. + ${FileSharePropertyShareQuota}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]] + # List of stored access policies specified on the share. + # To construct, see NOTES section for FILESHAREPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${FileSharePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageFileShare_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageFileShare_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Update-AzStorageQueue.ps1 b/swaggerci/storage/exports/Update-AzStorageQueue.ps1 new file mode 100644 index 000000000000..907b7ae95cd5 --- /dev/null +++ b/swaggerci/storage/exports/Update-AzStorageQueue.ps1 @@ -0,0 +1,223 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new queue with the specified queue name, under the specified account. +.Description +Creates a new queue with the specified queue name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragequeue +#> +function Update-AzStorageQueue { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('QueueName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info(PossibleTypes=([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata]))] + [System.Collections.Hashtable] + # A name-value pair that represents queue metadata. + ${QueuePropertyMetadata}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageQueue_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageQueue_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/exports/Update-AzStorageTable.ps1 b/swaggerci/storage/exports/Update-AzStorageTable.ps1 new file mode 100644 index 000000000000..7346392cab5c --- /dev/null +++ b/swaggerci/storage/exports/Update-AzStorageTable.ps1 @@ -0,0 +1,230 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Creates a new table with the specified table name, under the specified account. +.Description +Creates a new table with the specified table name, under the specified account. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Inputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable +.Notes +COMPLEX PARAMETER PROPERTIES + +To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables. + +INPUTOBJECT : Identity Parameter + [AccountName ]: The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + [BlobInventoryPolicyName ]: The name of the storage account blob inventory policy. It should always be 'default' + [BlobServicesName ]: The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + [ContainerName ]: The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [DeletedAccountName ]: Name of the deleted storage account. + [EncryptionScopeName ]: The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [FileServicesName ]: The name of the file Service within the specified storage account. File Service Name must be "default" + [Id ]: Resource identity path + [ImmutabilityPolicyName ]: The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default' + [Location ]: The location of the deleted storage account. + [ManagementPolicyName ]: The name of the Storage Account Management Policy. It should always be 'default' + [ObjectReplicationPolicyId ]: For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + [PrivateEndpointConnectionName ]: The name of the private endpoint connection associated with the Azure resource + [QueueName ]: A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters. + [QueueServiceName ]: The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + [ResourceGroupName ]: The name of the resource group within the user's subscription. The name is case insensitive. + [ShareName ]: The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number. + [SubscriptionId ]: The ID of the target subscription. + [TableName ]: A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + [TableServiceName ]: The name of the Table Service within the specified storage account. Table Service Name must be 'default' + [Username ]: The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account. + +TABLEPROPERTYSIGNEDIDENTIFIER : List of stored access policies specified on the table. + Id : unique-64-character-value of the stored access policy. + [AccessPolicyExpiryTime ]: Expiry time of the access policy + [AccessPolicyPermission ]: Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + [AccessPolicyStartTime ]: Start time of the access policy +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/update-azstoragetable +#> +function Update-AzStorageTable { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable])] +[CmdletBinding(DefaultParameterSetName='UpdateExpanded', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')] +param( + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the storage account within the specified resource group. + # Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + ${AccountName}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Alias('TableName')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + ${Name}, + + [Parameter(ParameterSetName='UpdateExpanded', Mandatory)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [System.String] + # The name of the resource group within the user's subscription. + # The name is case insensitive. + ${ResourceGroupName}, + + [Parameter(ParameterSetName='UpdateExpanded')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo(Script='(Get-AzContext).Subscription.Id')] + [System.String] + # The ID of the target subscription. + ${SubscriptionId}, + + [Parameter(ParameterSetName='UpdateViaIdentityExpanded', Mandatory, ValueFromPipeline)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Path')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity] + # Identity Parameter + # To construct, see NOTES section for INPUTOBJECT properties and create a hash table. + ${InputObject}, + + [Parameter()] + [AllowEmptyCollection()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Body')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]] + # List of stored access policies specified on the table. + # To construct, see NOTES section for TABLEPROPERTYSIGNEDIDENTIFIER properties and create a hash table. + ${TablePropertySignedIdentifier}, + + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) { + [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() + } + $preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + if ($preTelemetryId -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) + } else { + $internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + if ($internalCalledCmdlets -eq '') { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name + } else { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' + } + + $mapping = @{ + UpdateExpanded = 'Az.Storage.private\Update-AzStorageTable_UpdateExpanded'; + UpdateViaIdentityExpanded = 'Az.Storage.private\Update-AzStorageTable_UpdateViaIdentityExpanded'; + } + if (('UpdateExpanded') -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('SubscriptionId')) { + $PSBoundParameters['SubscriptionId'] = (Get-AzContext).Subscription.Id + } + $cmdInfo = Get-Command -Name $mapping[$parameterSet] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet) + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } + + finally { + $backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId + $backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + +} +end { + try { + $steppablePipeline.End() + + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets + if ($preTelemetryId -eq '') { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + } + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId + + } catch { + [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() + throw + } +} +} diff --git a/swaggerci/storage/generate-help.ps1 b/swaggerci/storage/generate-help.ps1 new file mode 100644 index 000000000000..97907362bdd3 --- /dev/null +++ b/swaggerci/storage/generate-help.ps1 @@ -0,0 +1,66 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated) +$ErrorActionPreference = 'Stop' + +$pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$exportsFolder = Join-Path $PSScriptRoot 'exports' +if(-not (Test-Path $exportsFolder)) { + Write-Error "Exports folder '$exportsFolder' was not found." +} + +$directories = Get-ChildItem -Directory -Path $exportsFolder +$hasProfiles = ($directories | Measure-Object).Count -gt 0 +if(-not $hasProfiles) { + $directories = Get-Item -Path $exportsFolder +} + +$docsFolder = Join-Path $PSScriptRoot 'docs' +if(Test-Path $docsFolder) { + $null = Get-ChildItem -Path $docsFolder -Recurse -Exclude 'README.md' | Remove-Item -Recurse -ErrorAction SilentlyContinue +} +$null = New-Item -ItemType Directory -Force -Path $docsFolder -ErrorAction SilentlyContinue +$examplesFolder = Join-Path $PSScriptRoot 'examples' + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.Storage.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +# Load DLL to use build-time cmdlets +Import-Module -Name $modulePath +Import-Module -Name (Join-Path $PSScriptRoot './bin/Az.Storage.private.dll') +$instance = [Microsoft.Azure.PowerShell.Cmdlets.Storage.Module]::Instance +# Module info is shared per profile +$moduleInfo = Get-Module -Name $moduleName + +foreach($directory in $directories) +{ + if($hasProfiles) { + Select-AzProfile -Name $directory.Name + } + # Reload module per profile + Import-Module -Name $modulePath -Force + + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $directory.FullName + $cmdletHelpInfo = $cmdletNames | ForEach-Object { Get-Help -Name $_ -Full } + $cmdletFunctionInfo = Get-ScriptCmdlet -ScriptFolder $directory.FullName -AsFunctionInfo + + $docsPath = Join-Path $docsFolder $directory.Name + $null = New-Item -ItemType Directory -Force -Path $docsPath -ErrorAction SilentlyContinue + $examplesPath = Join-Path $examplesFolder $directory.Name + + Export-HelpMarkdown -ModuleInfo $moduleInfo -FunctionInfo $cmdletFunctionInfo -HelpInfo $cmdletHelpInfo -DocsFolder $docsPath -ExamplesFolder $examplesPath + Write-Host -ForegroundColor Green "Created documentation in '$docsPath'" +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storage/generated/Module.cs b/swaggerci/storage/generated/Module.cs new file mode 100644 index 000000000000..4f4ae325e29b --- /dev/null +++ b/swaggerci/storage/generated/Module.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using SendAsyncStepDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + using PipelineChangeDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>; + using GetParameterDelegate = global::System.Func; + using ModuleLoadPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using ArgumentCompleterDelegate = global::System.Func; + using GetTelemetryIdDelegate = global::System.Func; + using TelemetryDelegate = global::System.Action; + using NewRequestPipelineDelegate = global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>, global::System.Action, global::System.Threading.Tasks.Task>, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>>>; + using SignalDelegate = global::System.Func, global::System.Threading.Tasks.Task>; + using EventListenerDelegate = global::System.Func, global::System.Func, global::System.Threading.Tasks.Task>, global::System.Management.Automation.InvocationInfo, string, string, string, global::System.Exception, global::System.Threading.Tasks.Task>; + using NextDelegate = global::System.Func, global::System.Threading.Tasks.Task>, global::System.Threading.Tasks.Task>; + + /// A class that contains the module-common code and data. + public partial class Module + { + /// The currently selected profile. + public string Profile = global::System.String.Empty; + + public global::System.Net.Http.HttpClientHandler _handler = new global::System.Net.Http.HttpClientHandler(); + + /// the ISendAsync pipeline instance + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline _pipeline; + + /// the ISendAsync pipeline instance (when proxy is enabled) + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline _pipelineWithProxy; + + public bool _useProxy = false; + + public global::System.Net.WebProxy _webProxy = new global::System.Net.WebProxy(); + + /// Gets completion data for azure specific fields + public ArgumentCompleterDelegate ArgumentCompleter { get; set; } + + /// The instance of the Client API + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient ClientAPI { get; set; } + + /// A delegate that gets called for each signalled event + public EventListenerDelegate EventListener { get; set; } + + /// The delegate to call to get parameter data from a common module. + public GetParameterDelegate GetParameterValue { get; set; } + + /// The delegate to get the telemetry Id. + public GetTelemetryIdDelegate GetTelemetryId { get; set; } + + /// Backing field for property. + private static Microsoft.Azure.PowerShell.Cmdlets.Storage.Module _instance; + + /// the singleton of this module class + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Module Instance => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module._instance?? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Module._instance = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Module()); + + /// The Name of this module + public string Name => @"Az.Storage"; + + /// The delegate to call when this module is loaded (supporting a commmon module). + public ModuleLoadPipelineDelegate OnModuleLoad { get; set; } + + /// The delegate to call before each new request (supporting a commmon module). + public NewRequestPipelineDelegate OnNewRequest { get; set; } + + /// The name of the currently selected Azure profile + public global::System.String ProfileName { get; set; } + + /// The ResourceID for this module (azure arm). + public string ResourceId => @"Az.Storage"; + + /// The delegate for creating a telemetry. + public TelemetryDelegate Telemetry { get; set; } + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void AfterCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline pipeline); + + /// The from the cmdlet + /// The HttpPipeline for the request + + partial void BeforeCreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline pipeline); + + partial void CustomInit(); + + /// Creates an instance of the HttpPipeline for each call. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the cmdlet's parameterset name. + /// a dict for extensible parameters + /// An instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline for the remote call. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline CreatePipeline(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string processRecordId, string parameterSetName = null, global::System.Collections.Generic.IDictionary extensibleParameters = null) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline pipeline = null; + BeforeCreatePipeline(invocationInfo, ref pipeline); + pipeline = (pipeline ?? (_useProxy ? _pipelineWithProxy : _pipeline)).Clone(); + AfterCreatePipeline(invocationInfo, ref pipeline); + pipeline.Append(new Runtime.CmdInfoHandler(processRecordId, invocationInfo, parameterSetName).SendAsync); + OnNewRequest?.Invoke( invocationInfo, correlationId,processRecordId, (step)=> { pipeline.Prepend(step); } , (step)=> { pipeline.Append(step); } ); + return pipeline; + } + + /// Gets parameters from a common module. + /// The from the cmdlet + /// the cmdlet's correlation id. + /// The name of the parameter to get the value for. + /// + /// The parameter value from the common module. (Note: this should be type converted on the way back) + /// + public object GetParameter(global::System.Management.Automation.InvocationInfo invocationInfo, string correlationId, string parameterName) => GetParameterValue?.Invoke( ResourceId, Name, invocationInfo, correlationId,parameterName ); + + /// Initialization steps performed after the module is loaded. + public void Init() + { + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipeline.Prepend(step); } , (step)=> { _pipeline.Append(step); } ); + OnModuleLoad?.Invoke( ResourceId, Name ,(step)=> { _pipelineWithProxy.Prepend(step); } , (step)=> { _pipelineWithProxy.Append(step); } ); + CustomInit(); + } + + /// Creates the module instance. + private Module() + { + // constructor + ClientAPI = new Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient(); + _handler.Proxy = _webProxy; + _pipeline = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient())); + _pipelineWithProxy = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpClientFactory(new global::System.Net.Http.HttpClient(_handler))); + } + + /// The HTTP Proxy to use. + /// The HTTP Proxy Credentials + /// True if the proxy should use default credentials + public void SetProxyConfiguration(global::System.Uri proxy, global::System.Management.Automation.PSCredential proxyCredential, bool proxyUseDefaultCredentials) + { + _useProxy = proxy != null; + if (proxy == null) + { + return; + } + // set the proxy configuration + _webProxy.Address = proxy; + _webProxy.BypassProxyOnLocal = false; + if (proxyUseDefaultCredentials) + { + _webProxy.Credentials = null; + _webProxy.UseDefaultCredentials = true; + } + else + { + _webProxy.UseDefaultCredentials = false; + _webProxy.Credentials = proxyCredential ?.GetNetworkCredential(); + } + } + + /// Called to dispatch events to the common module listener + /// The ID of the event + /// The cancellation token for the event + /// A delegate to get the detailed event data + /// The callback for the event dispatcher + /// The from the cmdlet + /// the cmdlet's parameterset name. + /// the cmdlet's correlation id. + /// the cmdlet's process record correlation id. + /// the exception that is being thrown (if available) + /// + /// A that will be complete when handling of the event is completed. + /// + public async global::System.Threading.Tasks.Task Signal(string id, global::System.Threading.CancellationToken token, global::System.Func getEventData, SignalDelegate signal, global::System.Management.Automation.InvocationInfo invocationInfo, string parameterSetName, string correlationId, string processRecordId, global::System.Exception exception) + { + using( NoSynchronizationContext ) + { + await EventListener?.Invoke(id,token,getEventData, signal, invocationInfo, parameterSetName, correlationId,processRecordId,exception); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.PowerShell.cs new file mode 100644 index 000000000000..dbd975b6f4aa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The resource model definition for an Azure Resource Manager resource with an etag. + /// + [System.ComponentModel.TypeConverter(typeof(AzureEntityResourceTypeConverter))] + public partial class AzureEntityResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureEntityResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureEntityResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureEntityResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureEntityResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource model definition for an Azure Resource Manager resource with an etag. + [System.ComponentModel.TypeConverter(typeof(AzureEntityResourceTypeConverter))] + public partial interface IAzureEntityResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.TypeConverter.cs new file mode 100644 index 000000000000..a0b16f0dc8e5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureEntityResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureEntityResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureEntityResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureEntityResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.cs b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.cs new file mode 100644 index 000000000000..1d429ac319c6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The resource model definition for an Azure Resource Manager resource with an etag. + /// + public partial class AzureEntityResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// Backing field for property. + private string _etag; + + /// Resource Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public AzureEntityResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource model definition for an Azure Resource Manager resource with an etag. + public partial interface IAzureEntityResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// Resource Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Resource Etag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + + } + /// The resource model definition for an Azure Resource Manager resource with an etag. + internal partial interface IAzureEntityResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// Resource Etag. + string Etag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.json.cs b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.json.cs new file mode 100644 index 000000000000..602cf80cd0d0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/AzureEntityResource.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The resource model definition for an Azure Resource Manager resource with an etag. + /// + public partial class AzureEntityResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal AzureEntityResource(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new AzureEntityResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/ProxyResource.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.PowerShell.cs new file mode 100644 index 000000000000..794c70798cf5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial class ProxyResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProxyResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProxyResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProxyResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProxyResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + [System.ComponentModel.TypeConverter(typeof(ProxyResourceTypeConverter))] + public partial interface IProxyResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/ProxyResource.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.TypeConverter.cs new file mode 100644 index 000000000000..d7775b540f33 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProxyResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProxyResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProxyResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/ProxyResource.cs b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.cs new file mode 100644 index 000000000000..49d0f0c72b9e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ProxyResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + public partial interface IProxyResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + + } + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + internal partial interface IProxyResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/ProxyResource.json.cs b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.json.cs new file mode 100644 index 000000000000..ed3f78ca5000 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/ProxyResource.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location + /// + public partial class ProxyResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IProxyResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ProxyResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ProxyResource(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/Resource.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api10/Resource.PowerShell.cs new file mode 100644 index 000000000000..713c8c561ecb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/Resource.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial class Resource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Resource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Resource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Resource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Resource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + [System.ComponentModel.TypeConverter(typeof(ResourceTypeConverter))] + public partial interface IResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/Resource.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api10/Resource.TypeConverter.cs new file mode 100644 index 000000000000..b66223452700 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/Resource.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Resource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Resource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Resource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/Resource.cs b/swaggerci/storage/generated/api/Models/Api10/Resource.cs new file mode 100644 index 000000000000..34ac07d6a308 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/Resource.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + + /// Backing field for property. + private string _id; + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => this._id; set { {_id = value;} } } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _type; + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public Resource() + { + + } + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + public partial interface IResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of the resource", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the resource. E.g. ""Microsoft.Compute/virtualMachines"" or ""Microsoft.Storage/storageAccounts""", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// Common fields that are returned in the response for all Azure Resource Manager resources + internal partial interface IResourceInternal + + { + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + string Id { get; set; } + /// The name of the resource + string Name { get; set; } + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/Resource.json.cs b/swaggerci/storage/generated/api/Models/Api10/Resource.json.cs new file mode 100644 index 000000000000..f4dcf8acff51 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/Resource.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Common fields that are returned in the response for all Azure Resource Manager resources + /// + public partial class Resource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Resource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Resource(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResource.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.PowerShell.cs new file mode 100644 index 000000000000..d53d73253b75 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + /// + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial class TrackedResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTypeConverter))] + public partial interface ITrackedResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResource.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.TypeConverter.cs new file mode 100644 index 000000000000..4fe3a4a45488 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResource.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.cs new file mode 100644 index 000000000000..ed9424f8f92a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Backing field for property. + private string _location; + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags _tag; + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTags()); set => this._tag = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TrackedResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + public partial interface ITrackedResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The geo-location where the resource lives", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource tags.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags Tag { get; set; } + + } + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + internal partial interface ITrackedResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// The geo-location where the resource lives + string Location { get; set; } + /// Resource tags. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResource.json.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.json.cs new file mode 100644 index 000000000000..96638ee0210c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResource.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' + /// + public partial class TrackedResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TrackedResource(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TrackedResource(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTags.FromJson(__jsonTags) : Tag;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs new file mode 100644 index 000000000000..ffd91806a208 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial class TrackedResourceTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TrackedResourceTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TrackedResourceTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TrackedResourceTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TrackedResourceTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + } + /// Resource tags. + [System.ComponentModel.TypeConverter(typeof(TrackedResourceTagsTypeConverter))] + public partial interface ITrackedResourceTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs new file mode 100644 index 000000000000..b8cd90fb38e8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TrackedResourceTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TrackedResourceTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TrackedResourceTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.cs new file mode 100644 index 000000000000..48a46e99ddb8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTagsInternal + { + + /// Creates an new instance. + public TrackedResourceTags() + { + + } + } + /// Resource tags. + public partial interface ITrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// Resource tags. + internal partial interface ITrackedResourceTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs new file mode 100644 index 000000000000..91bfed0047b7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class TrackedResourceTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.json.cs b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.json.cs new file mode 100644 index 000000000000..25b2e105a559 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api10/TrackedResourceTags.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Resource tags. + public partial class TrackedResourceTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TrackedResourceTags(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal TrackedResourceTags(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20/SystemData.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20/SystemData.PowerShell.cs new file mode 100644 index 000000000000..9dba1cfa6a84 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20/SystemData.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial class SystemData + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SystemData(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SystemData(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SystemData(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SystemData(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedBy = (string) content.GetValueForProperty("CreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedBy, global::System.Convert.ToString); + } + if (content.Contains("CreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("CreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("CreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedAt = (global::System.DateTime?) content.GetValueForProperty("CreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).CreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedBy = (string) content.GetValueForProperty("LastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("LastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("LastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("LastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("LastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)this).LastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metadata pertaining to creation and last modification of the resource. + [System.ComponentModel.TypeConverter(typeof(SystemDataTypeConverter))] + public partial interface ISystemData + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20/SystemData.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20/SystemData.TypeConverter.cs new file mode 100644 index 000000000000..db7143b1093a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20/SystemData.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SystemDataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SystemData.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SystemData.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20/SystemData.cs b/swaggerci/storage/generated/api/Models/Api20/SystemData.cs new file mode 100644 index 000000000000..2f03150617ec --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20/SystemData.cs @@ -0,0 +1,136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal + { + + /// Backing field for property. + private global::System.DateTime? _createdAt; + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? CreatedAt { get => this._createdAt; set => this._createdAt = value; } + + /// Backing field for property. + private string _createdBy; + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string CreatedBy { get => this._createdBy; set => this._createdBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? _createdByType; + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? CreatedByType { get => this._createdByType; set => this._createdByType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedAt; + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedAt { get => this._lastModifiedAt; set => this._lastModifiedAt = value; } + + /// Backing field for property. + private string _lastModifiedBy; + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LastModifiedBy { get => this._lastModifiedBy; set => this._lastModifiedBy = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? _lastModifiedByType; + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? LastModifiedByType { get => this._lastModifiedByType; set => this._lastModifiedByType = value; } + + /// Creates an new instance. + public SystemData() + { + + } + } + /// Metadata pertaining to creation and last modification of the resource. + public partial interface ISystemData : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string CreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? LastModifiedByType { get; set; } + + } + /// Metadata pertaining to creation and last modification of the resource. + internal partial interface ISystemDataInternal + + { + /// The timestamp of resource creation (UTC). + global::System.DateTime? CreatedAt { get; set; } + /// The identity that created the resource. + string CreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? CreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? LastModifiedAt { get; set; } + /// The identity that last modified the resource. + string LastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? LastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20/SystemData.json.cs b/swaggerci/storage/generated/api/Models/Api20/SystemData.json.cs new file mode 100644 index 000000000000..af97539b53b0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20/SystemData.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Metadata pertaining to creation and last modification of the resource. + public partial class SystemData + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new SystemData(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal SystemData(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_createdBy = If( json?.PropertyT("createdBy"), out var __jsonCreatedBy) ? (string)__jsonCreatedBy : (string)CreatedBy;} + {_createdByType = If( json?.PropertyT("createdByType"), out var __jsonCreatedByType) ? (string)__jsonCreatedByType : (string)CreatedByType;} + {_createdAt = If( json?.PropertyT("createdAt"), out var __jsonCreatedAt) ? global::System.DateTime.TryParse((string)__jsonCreatedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreatedAtValue) ? __jsonCreatedAtValue : CreatedAt : CreatedAt;} + {_lastModifiedBy = If( json?.PropertyT("lastModifiedBy"), out var __jsonLastModifiedBy) ? (string)__jsonLastModifiedBy : (string)LastModifiedBy;} + {_lastModifiedByType = If( json?.PropertyT("lastModifiedByType"), out var __jsonLastModifiedByType) ? (string)__jsonLastModifiedByType : (string)LastModifiedByType;} + {_lastModifiedAt = If( json?.PropertyT("lastModifiedAt"), out var __jsonLastModifiedAt) ? global::System.DateTime.TryParse((string)__jsonLastModifiedAt, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedAtValue) ? __jsonLastModifiedAtValue : LastModifiedAt : LastModifiedAt;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._createdBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._createdBy.ToString()) : null, "createdBy" ,container.Add ); + AddIf( null != (((object)this._createdByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._createdByType.ToString()) : null, "createdByType" ,container.Add ); + AddIf( null != this._createdAt ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._createdAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "createdAt" ,container.Add ); + AddIf( null != (((object)this._lastModifiedBy)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedBy.ToString()) : null, "lastModifiedBy" ,container.Add ); + AddIf( null != (((object)this._lastModifiedByType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedByType.ToString()) : null, "lastModifiedByType" ,container.Add ); + AddIf( null != this._lastModifiedAt ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedAt?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedAt" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.PowerShell.cs new file mode 100644 index 000000000000..b5451d1f5919 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(AccessPolicyTypeConverter))] + public partial class AccessPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AccessPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).ExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).Permission, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AccessPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).ExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)this).Permission, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AccessPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AccessPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(AccessPolicyTypeConverter))] + public partial interface IAccessPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.TypeConverter.cs new file mode 100644 index 000000000000..d5eb7f1bbea2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AccessPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AccessPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AccessPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AccessPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.cs new file mode 100644 index 000000000000..27b4e489a693 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class AccessPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal + { + + /// Backing field for property. + private global::System.DateTime? _expiryTime; + + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? ExpiryTime { get => this._expiryTime; set => this._expiryTime = value; } + + /// Backing field for property. + private string _permission; + + /// List of abbreviated permissions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Permission { get => this._permission; set => this._permission = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Creates an new instance. + public AccessPolicy() + { + + } + } + public partial interface IAccessPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of the access policy", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpiryTime { get; set; } + /// List of abbreviated permissions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of abbreviated permissions.", + SerializedName = @"permission", + PossibleTypes = new [] { typeof(string) })] + string Permission { get; set; } + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of the access policy", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + + } + internal partial interface IAccessPolicyInternal + + { + /// Expiry time of the access policy + global::System.DateTime? ExpiryTime { get; set; } + /// List of abbreviated permissions. + string Permission { get; set; } + /// Start time of the access policy + global::System.DateTime? StartTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.json.cs new file mode 100644 index 000000000000..c08bdb9bc2ee --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccessPolicy.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class AccessPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal AccessPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_expiryTime = If( json?.PropertyT("expiryTime"), out var __jsonExpiryTime) ? global::System.DateTime.TryParse((string)__jsonExpiryTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryTimeValue) ? __jsonExpiryTimeValue : ExpiryTime : ExpiryTime;} + {_permission = If( json?.PropertyT("permission"), out var __jsonPermission) ? (string)__jsonPermission : (string)Permission;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new AccessPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._expiryTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._expiryTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expiryTime" ,container.Add ); + AddIf( null != (((object)this._permission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._permission.ToString()) : null, "permission" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..3fafcd0ad8d0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// This defines account-level immutability policy properties. + [System.ComponentModel.TypeConverter(typeof(AccountImmutabilityPolicyPropertiesTypeConverter))] + public partial class AccountImmutabilityPolicyProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AccountImmutabilityPolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AccountImmutabilityPolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AccountImmutabilityPolicyProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AccountImmutabilityPolicyProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This defines account-level immutability policy properties. + [System.ComponentModel.TypeConverter(typeof(AccountImmutabilityPolicyPropertiesTypeConverter))] + public partial interface IAccountImmutabilityPolicyProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..6a17ce84c5a4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AccountImmutabilityPolicyPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AccountImmutabilityPolicyProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AccountImmutabilityPolicyProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AccountImmutabilityPolicyProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.cs new file mode 100644 index 000000000000..5e190882fe30 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// This defines account-level immutability policy properties. + public partial class AccountImmutabilityPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal + { + + /// Backing field for property. + private bool? _allowProtectedAppendWrite; + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowProtectedAppendWrite { get => this._allowProtectedAppendWrite; set => this._allowProtectedAppendWrite = value; } + + /// Backing field for property. + private int? _immutabilityPeriodSinceCreationInDay; + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? ImmutabilityPeriodSinceCreationInDay { get => this._immutabilityPeriodSinceCreationInDay; set => this._immutabilityPeriodSinceCreationInDay = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? _state; + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public AccountImmutabilityPolicyProperties() + { + + } + } + /// This defines account-level immutability policy properties. + public partial interface IAccountImmutabilityPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? State { get; set; } + + } + /// This defines account-level immutability policy properties. + internal partial interface IAccountImmutabilityPolicyPropertiesInternal + + { + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? AllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.json.cs new file mode 100644 index 000000000000..a8491aec8d3b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountImmutabilityPolicyProperties.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// This defines account-level immutability policy properties. + public partial class AccountImmutabilityPolicyProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal AccountImmutabilityPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_immutabilityPeriodSinceCreationInDay = If( json?.PropertyT("immutabilityPeriodSinceCreationInDays"), out var __jsonImmutabilityPeriodSinceCreationInDays) ? (int?)__jsonImmutabilityPeriodSinceCreationInDays : ImmutabilityPeriodSinceCreationInDay;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_allowProtectedAppendWrite = If( json?.PropertyT("allowProtectedAppendWrites"), out var __jsonAllowProtectedAppendWrites) ? (bool?)__jsonAllowProtectedAppendWrites : AllowProtectedAppendWrite;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new AccountImmutabilityPolicyProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._immutabilityPeriodSinceCreationInDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._immutabilityPeriodSinceCreationInDay) : null, "immutabilityPeriodSinceCreationInDays" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AddIf( null != this._allowProtectedAppendWrite ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowProtectedAppendWrite) : null, "allowProtectedAppendWrites" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.PowerShell.cs new file mode 100644 index 000000000000..3a535e474e23 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The parameters to list SAS credentials of a storage account. + [System.ComponentModel.TypeConverter(typeof(AccountSasParametersTypeConverter))] + public partial class AccountSasParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AccountSasParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).ResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).ResourceType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SharedAccessExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyToSign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).KeyToSign, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AccountSasParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).ResourceType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).ResourceType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SharedAccessExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).SharedAccessExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyToSign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal)this).KeyToSign, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AccountSasParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AccountSasParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters to list SAS credentials of a storage account. + [System.ComponentModel.TypeConverter(typeof(AccountSasParametersTypeConverter))] + public partial interface IAccountSasParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.TypeConverter.cs new file mode 100644 index 000000000000..692738e5d348 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AccountSasParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AccountSasParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AccountSasParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AccountSasParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.cs new file mode 100644 index 000000000000..c54676cc7dec --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters to list SAS credentials of a storage account. + public partial class AccountSasParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParametersInternal + { + + /// Backing field for property. + private string _iPAddressOrRange; + + /// An IP address or a range of IP addresses from which to accept requests. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string IPAddressOrRange { get => this._iPAddressOrRange; set => this._iPAddressOrRange = value; } + + /// Backing field for property. + private string _keyToSign; + + /// The key to sign the account SAS token with. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyToSign { get => this._keyToSign; set => this._keyToSign = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions _permission; + + /// + /// The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions Permission { get => this._permission; set => this._permission = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? _protocol; + + /// The protocol permitted for a request made with the account SAS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes _resourceType; + + /// + /// The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container + /// (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, + /// and files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes ResourceType { get => this._resourceType; set => this._resourceType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services _service; + + /// + /// The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services Service { get => this._service; set => this._service = value; } + + /// Backing field for property. + private global::System.DateTime _sharedAccessExpiryTime; + + /// The time at which the shared access signature becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime SharedAccessExpiryTime { get => this._sharedAccessExpiryTime; set => this._sharedAccessExpiryTime = value; } + + /// Backing field for property. + private global::System.DateTime? _sharedAccessStartTime; + + /// The time at which the SAS becomes valid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? SharedAccessStartTime { get => this._sharedAccessStartTime; set => this._sharedAccessStartTime = value; } + + /// Creates an new instance. + public AccountSasParameters() + { + + } + } + /// The parameters to list SAS credentials of a storage account. + public partial interface IAccountSasParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// An IP address or a range of IP addresses from which to accept requests. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An IP address or a range of IP addresses from which to accept requests.", + SerializedName = @"signedIp", + PossibleTypes = new [] { typeof(string) })] + string IPAddressOrRange { get; set; } + /// The key to sign the account SAS token with. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key to sign the account SAS token with.", + SerializedName = @"keyToSign", + PossibleTypes = new [] { typeof(string) })] + string KeyToSign { get; set; } + /// + /// The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).", + SerializedName = @"signedPermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions Permission { get; set; } + /// The protocol permitted for a request made with the account SAS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The protocol permitted for a request made with the account SAS.", + SerializedName = @"signedProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? Protocol { get; set; } + /// + /// The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container + /// (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, + /// and files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files.", + SerializedName = @"signedResourceTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes ResourceType { get; set; } + /// + /// The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f).", + SerializedName = @"signedServices", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services Service { get; set; } + /// The time at which the shared access signature becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time at which the shared access signature becomes invalid.", + SerializedName = @"signedExpiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime SharedAccessExpiryTime { get; set; } + /// The time at which the SAS becomes valid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which the SAS becomes valid.", + SerializedName = @"signedStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SharedAccessStartTime { get; set; } + + } + /// The parameters to list SAS credentials of a storage account. + internal partial interface IAccountSasParametersInternal + + { + /// An IP address or a range of IP addresses from which to accept requests. + string IPAddressOrRange { get; set; } + /// The key to sign the account SAS token with. + string KeyToSign { get; set; } + /// + /// The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions Permission { get; set; } + /// The protocol permitted for a request made with the account SAS. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? Protocol { get; set; } + /// + /// The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container + /// (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, + /// and files. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes ResourceType { get; set; } + /// + /// The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services Service { get; set; } + /// The time at which the shared access signature becomes invalid. + global::System.DateTime SharedAccessExpiryTime { get; set; } + /// The time at which the SAS becomes valid. + global::System.DateTime? SharedAccessStartTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.json.cs new file mode 100644 index 000000000000..ea6b8a5d502b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AccountSasParameters.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters to list SAS credentials of a storage account. + public partial class AccountSasParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal AccountSasParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_service = If( json?.PropertyT("signedServices"), out var __jsonSignedServices) ? (string)__jsonSignedServices : (string)Service;} + {_resourceType = If( json?.PropertyT("signedResourceTypes"), out var __jsonSignedResourceTypes) ? (string)__jsonSignedResourceTypes : (string)ResourceType;} + {_permission = If( json?.PropertyT("signedPermission"), out var __jsonSignedPermission) ? (string)__jsonSignedPermission : (string)Permission;} + {_iPAddressOrRange = If( json?.PropertyT("signedIp"), out var __jsonSignedIP) ? (string)__jsonSignedIP : (string)IPAddressOrRange;} + {_protocol = If( json?.PropertyT("signedProtocol"), out var __jsonSignedProtocol) ? (string)__jsonSignedProtocol : (string)Protocol;} + {_sharedAccessStartTime = If( json?.PropertyT("signedStart"), out var __jsonSignedStart) ? global::System.DateTime.TryParse((string)__jsonSignedStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSignedStartValue) ? __jsonSignedStartValue : SharedAccessStartTime : SharedAccessStartTime;} + {_sharedAccessExpiryTime = If( json?.PropertyT("signedExpiry"), out var __jsonSignedExpiry) ? global::System.DateTime.TryParse((string)__jsonSignedExpiry, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSignedExpiryValue) ? __jsonSignedExpiryValue : SharedAccessExpiryTime : SharedAccessExpiryTime;} + {_keyToSign = If( json?.PropertyT("keyToSign"), out var __jsonKeyToSign) ? (string)__jsonKeyToSign : (string)KeyToSign;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new AccountSasParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._service)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._service.ToString()) : null, "signedServices" ,container.Add ); + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "signedResourceTypes" ,container.Add ); + AddIf( null != (((object)this._permission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._permission.ToString()) : null, "signedPermission" ,container.Add ); + AddIf( null != (((object)this._iPAddressOrRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._iPAddressOrRange.ToString()) : null, "signedIp" ,container.Add ); + AddIf( null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._protocol.ToString()) : null, "signedProtocol" ,container.Add ); + AddIf( null != this._sharedAccessStartTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sharedAccessStartTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "signedStart" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sharedAccessExpiryTime.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "signedExpiry" ,container.Add ); + AddIf( null != (((object)this._keyToSign)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyToSign.ToString()) : null, "keyToSign" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.PowerShell.cs new file mode 100644 index 000000000000..cdf70a7d5e77 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Settings properties for Active Directory (AD). + [System.ComponentModel.TypeConverter(typeof(ActiveDirectoryPropertiesTypeConverter))] + public partial class ActiveDirectoryProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ActiveDirectoryProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("NetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName = (string) content.GetValueForProperty("NetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).ForestName = (string) content.GetValueForProperty("ForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).ForestName, global::System.Convert.ToString); + } + if (content.Contains("DomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainGuid = (string) content.GetValueForProperty("DomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainGuid, global::System.Convert.ToString); + } + if (content.Contains("DomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainSid = (string) content.GetValueForProperty("DomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainSid, global::System.Convert.ToString); + } + if (content.Contains("AzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid = (string) content.GetValueForProperty("AzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("SamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).SamAccountName = (string) content.GetValueForProperty("SamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).SamAccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ActiveDirectoryProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainName = (string) content.GetValueForProperty("DomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainName, global::System.Convert.ToString); + } + if (content.Contains("NetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName = (string) content.GetValueForProperty("NetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).NetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).ForestName = (string) content.GetValueForProperty("ForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).ForestName, global::System.Convert.ToString); + } + if (content.Contains("DomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainGuid = (string) content.GetValueForProperty("DomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainGuid, global::System.Convert.ToString); + } + if (content.Contains("DomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainSid = (string) content.GetValueForProperty("DomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).DomainSid, global::System.Convert.ToString); + } + if (content.Contains("AzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid = (string) content.GetValueForProperty("AzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("SamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).SamAccountName = (string) content.GetValueForProperty("SamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).SamAccountName, global::System.Convert.ToString); + } + if (content.Contains("AccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("AccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)this).AccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ActiveDirectoryProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ActiveDirectoryProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Settings properties for Active Directory (AD). + [System.ComponentModel.TypeConverter(typeof(ActiveDirectoryPropertiesTypeConverter))] + public partial interface IActiveDirectoryProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.TypeConverter.cs new file mode 100644 index 000000000000..96722d56a1bc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ActiveDirectoryPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ActiveDirectoryProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ActiveDirectoryProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ActiveDirectoryProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.cs new file mode 100644 index 000000000000..9f0a5c733914 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Settings properties for Active Directory (AD). + public partial class ActiveDirectoryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? _accountType; + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? AccountType { get => this._accountType; set => this._accountType = value; } + + /// Backing field for property. + private string _azureStorageSid; + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string AzureStorageSid { get => this._azureStorageSid; set => this._azureStorageSid = value; } + + /// Backing field for property. + private string _domainGuid; + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DomainGuid { get => this._domainGuid; set => this._domainGuid = value; } + + /// Backing field for property. + private string _domainName; + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DomainName { get => this._domainName; set => this._domainName = value; } + + /// Backing field for property. + private string _domainSid; + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DomainSid { get => this._domainSid; set => this._domainSid = value; } + + /// Backing field for property. + private string _forestName; + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ForestName { get => this._forestName; set => this._forestName = value; } + + /// Backing field for property. + private string _netBiosDomainName; + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NetBiosDomainName { get => this._netBiosDomainName; set => this._netBiosDomainName = value; } + + /// Backing field for property. + private string _samAccountName; + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SamAccountName { get => this._samAccountName; set => this._samAccountName = value; } + + /// Creates an new instance. + public ActiveDirectoryProperties() + { + + } + } + /// Settings properties for Active Directory (AD). + public partial interface IActiveDirectoryProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? AccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string AzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string DomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string DomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string DomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string NetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string SamAccountName { get; set; } + + } + /// Settings properties for Active Directory (AD). + internal partial interface IActiveDirectoryPropertiesInternal + + { + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? AccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string AzureStorageSid { get; set; } + /// Specifies the domain GUID. + string DomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string DomainName { get; set; } + /// Specifies the security identifier (SID). + string DomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ForestName { get; set; } + /// Specifies the NetBIOS domain name. + string NetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string SamAccountName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.json.cs new file mode 100644 index 000000000000..89b586d28c7d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ActiveDirectoryProperties.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Settings properties for Active Directory (AD). + public partial class ActiveDirectoryProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ActiveDirectoryProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_domainName = If( json?.PropertyT("domainName"), out var __jsonDomainName) ? (string)__jsonDomainName : (string)DomainName;} + {_netBiosDomainName = If( json?.PropertyT("netBiosDomainName"), out var __jsonNetBiosDomainName) ? (string)__jsonNetBiosDomainName : (string)NetBiosDomainName;} + {_forestName = If( json?.PropertyT("forestName"), out var __jsonForestName) ? (string)__jsonForestName : (string)ForestName;} + {_domainGuid = If( json?.PropertyT("domainGuid"), out var __jsonDomainGuid) ? (string)__jsonDomainGuid : (string)DomainGuid;} + {_domainSid = If( json?.PropertyT("domainSid"), out var __jsonDomainSid) ? (string)__jsonDomainSid : (string)DomainSid;} + {_azureStorageSid = If( json?.PropertyT("azureStorageSid"), out var __jsonAzureStorageSid) ? (string)__jsonAzureStorageSid : (string)AzureStorageSid;} + {_samAccountName = If( json?.PropertyT("samAccountName"), out var __jsonSamAccountName) ? (string)__jsonSamAccountName : (string)SamAccountName;} + {_accountType = If( json?.PropertyT("accountType"), out var __jsonAccountType) ? (string)__jsonAccountType : (string)AccountType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ActiveDirectoryProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._domainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._domainName.ToString()) : null, "domainName" ,container.Add ); + AddIf( null != (((object)this._netBiosDomainName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._netBiosDomainName.ToString()) : null, "netBiosDomainName" ,container.Add ); + AddIf( null != (((object)this._forestName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._forestName.ToString()) : null, "forestName" ,container.Add ); + AddIf( null != (((object)this._domainGuid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._domainGuid.ToString()) : null, "domainGuid" ,container.Add ); + AddIf( null != (((object)this._domainSid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._domainSid.ToString()) : null, "domainSid" ,container.Add ); + AddIf( null != (((object)this._azureStorageSid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._azureStorageSid.ToString()) : null, "azureStorageSid" ,container.Add ); + AddIf( null != (((object)this._samAccountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._samAccountName.ToString()) : null, "samAccountName" ,container.Add ); + AddIf( null != (((object)this._accountType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accountType.ToString()) : null, "accountType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.PowerShell.cs new file mode 100644 index 000000000000..4f5c2483ab51 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.PowerShell.cs @@ -0,0 +1,229 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Settings for Azure Files identity based authentication. + [System.ComponentModel.TypeConverter(typeof(AzureFilesIdentityBasedAuthenticationTypeConverter))] + public partial class AzureFilesIdentityBasedAuthentication + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal AzureFilesIdentityBasedAuthentication(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("ActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("DirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("DefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("DefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal AzureFilesIdentityBasedAuthentication(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("ActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("DirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("DirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("DefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("DefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).DefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new AzureFilesIdentityBasedAuthentication(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new AzureFilesIdentityBasedAuthentication(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Settings for Azure Files identity based authentication. + [System.ComponentModel.TypeConverter(typeof(AzureFilesIdentityBasedAuthenticationTypeConverter))] + public partial interface IAzureFilesIdentityBasedAuthentication + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.TypeConverter.cs new file mode 100644 index 000000000000..ce6aab3d195d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class AzureFilesIdentityBasedAuthenticationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AzureFilesIdentityBasedAuthentication.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return AzureFilesIdentityBasedAuthentication.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return AzureFilesIdentityBasedAuthentication.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.cs b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.cs new file mode 100644 index 000000000000..e22327358640 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Settings for Azure Files identity based authentication. + public partial class AzureFilesIdentityBasedAuthentication : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties _activeDirectoryProperty; + + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties ActiveDirectoryProperty { get => (this._activeDirectoryProperty = this._activeDirectoryProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryProperties()); set => this._activeDirectoryProperty = value; } + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).AccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).AccountType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); } + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyAzureStorageSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).AzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).AzureStorageSid = value ?? null; } + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainGuid = value ?? null; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainName = value ?? null; } + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).DomainSid = value ?? null; } + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyForestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).ForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).ForestName = value ?? null; } + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyNetBiosDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).NetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).NetBiosDomainName = value ?? null; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertySamAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).SamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryPropertiesInternal)ActiveDirectoryProperty).SamAccountName = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? _defaultSharePermission; + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? DefaultSharePermission { get => this._defaultSharePermission; set => this._defaultSharePermission = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions _directoryServiceOption; + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions DirectoryServiceOption { get => this._directoryServiceOption; set => this._directoryServiceOption = value; } + + /// Internal Acessors for ActiveDirectoryProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal.ActiveDirectoryProperty { get => (this._activeDirectoryProperty = this._activeDirectoryProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryProperties()); set { {_activeDirectoryProperty = value;} } } + + /// Creates an new instance. + public AzureFilesIdentityBasedAuthentication() + { + + } + } + /// Settings for Azure Files identity based authentication. + public partial interface IAzureFilesIdentityBasedAuthentication : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? DefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions DirectoryServiceOption { get; set; } + + } + /// Settings for Azure Files identity based authentication. + internal partial interface IAzureFilesIdentityBasedAuthenticationInternal + + { + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties ActiveDirectoryProperty { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? DefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions DirectoryServiceOption { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.json.cs new file mode 100644 index 000000000000..9ced095638bd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/AzureFilesIdentityBasedAuthentication.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Settings for Azure Files identity based authentication. + public partial class AzureFilesIdentityBasedAuthentication + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal AzureFilesIdentityBasedAuthentication(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_activeDirectoryProperty = If( json?.PropertyT("activeDirectoryProperties"), out var __jsonActiveDirectoryProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryProperties.FromJson(__jsonActiveDirectoryProperties) : ActiveDirectoryProperty;} + {_directoryServiceOption = If( json?.PropertyT("directoryServiceOptions"), out var __jsonDirectoryServiceOptions) ? (string)__jsonDirectoryServiceOptions : (string)DirectoryServiceOption;} + {_defaultSharePermission = If( json?.PropertyT("defaultSharePermission"), out var __jsonDefaultSharePermission) ? (string)__jsonDefaultSharePermission : (string)DefaultSharePermission;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new AzureFilesIdentityBasedAuthentication(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._activeDirectoryProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._activeDirectoryProperty.ToJson(null,serializationMode) : null, "activeDirectoryProperties" ,container.Add ); + AddIf( null != (((object)this._directoryServiceOption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._directoryServiceOption.ToString()) : null, "directoryServiceOptions" ,container.Add ); + AddIf( null != (((object)this._defaultSharePermission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._defaultSharePermission.ToString()) : null, "defaultSharePermission" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.PowerShell.cs new file mode 100644 index 000000000000..aa38f167271e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Properties of the blob container, including Id, resource name, resource type, Etag. + /// + [System.ComponentModel.TypeConverter(typeof(BlobContainerTypeConverter))] + public partial class BlobContainer + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobContainer(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContainerProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainerInternal)this).ContainerProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) content.GetValueForProperty("ContainerProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainerInternal)this).ContainerProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobContainer(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ContainerProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainerInternal)this).ContainerProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) content.GetValueForProperty("ContainerProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainerInternal)this).ContainerProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobContainer(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobContainer(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the blob container, including Id, resource name, resource type, Etag. + [System.ComponentModel.TypeConverter(typeof(BlobContainerTypeConverter))] + public partial interface IBlobContainer + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.TypeConverter.cs new file mode 100644 index 000000000000..82d277644468 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobContainerTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobContainer.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobContainer.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobContainer.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.cs new file mode 100644 index 000000000000..daa5d68b7fd9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Properties of the blob container, including Id, resource name, resource type, Etag. + /// + public partial class BlobContainer : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainerInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties _containerProperty; + + /// Properties of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties ContainerProperty { get => (this._containerProperty = this._containerProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerProperties()); set => this._containerProperty = value; } + + /// Resource Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; } + + /// Creates an new instance. + public BlobContainer() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureEntityResource), __azureEntityResource); + await eventListener.AssertObjectIsValid(nameof(__azureEntityResource), __azureEntityResource); + } + } + /// Properties of the blob container, including Id, resource name, resource type, Etag. + public partial interface IBlobContainer : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource + { + /// Properties of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Properties of the blob container.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties ContainerProperty { get; set; } + + } + /// Properties of the blob container, including Id, resource name, resource type, Etag. + internal partial interface IBlobContainerInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal + { + /// Properties of the blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties ContainerProperty { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.json.cs new file mode 100644 index 000000000000..40d310ee8678 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobContainer.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Properties of the blob container, including Id, resource name, resource type, Etag. + /// + public partial class BlobContainer + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobContainer(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(json); + {_containerProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerProperties.FromJson(__jsonProperties) : ContainerProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobContainer(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureEntityResource?.ToJson(container, serializationMode); + AddIf( null != this._containerProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._containerProperty.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.PowerShell.cs new file mode 100644 index 000000000000..6f8336adc865 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.PowerShell.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The storage account blob inventory policy. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyTypeConverter))] + public partial class BlobInventoryPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobInventoryPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobInventoryPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInventoryPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInventoryPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage account blob inventory policy. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyTypeConverter))] + public partial interface IBlobInventoryPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.TypeConverter.cs new file mode 100644 index 000000000000..e8bea1d209e7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInventoryPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInventoryPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInventoryPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInventoryPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.cs new file mode 100644 index 000000000000..890da7e3b160 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.cs @@ -0,0 +1,286 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account blob inventory policy. + public partial class BlobInventoryPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Returns the last modified date and time of the blob inventory policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).LastModifiedTime; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal.Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).Policy = value; } + + /// Internal Acessors for PolicyDestination + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal.PolicyDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyDestination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyDestination = value; } + + /// Internal Acessors for PolicyType + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal.PolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyType = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyProperties()); set { {_property = value;} } } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PolicyDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyDestination; } + + /// Policy is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? PolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyEnabled = value ?? default(bool); } + + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyRule = value ?? null /* arrayOf */; } + + /// The valid value is Inventory + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)Property).PolicyType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties _property; + + /// Returns the storage account blob inventory policy rules. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyProperties()); set => this._property = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public BlobInventoryPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The storage account blob inventory policy. + public partial interface IBlobInventoryPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// Returns the last modified date and time of the blob inventory policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the last modified date and time of the blob inventory policy.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at the rule level 'policy.rule.destination'", + SerializedName = @"destination", + PossibleTypes = new [] { typeof(string) })] + string PolicyDestination { get; } + /// Policy is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy is enabled if set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? PolicyEnabled { get; set; } + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account blob inventory policy rules. The rule is applied when it is enabled.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] PolicyRule { get; set; } + /// The valid value is Inventory + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The valid value is Inventory", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string PolicyType { get; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// The storage account blob inventory policy. + internal partial interface IBlobInventoryPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// Returns the last modified date and time of the blob inventory policy. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// The storage account blob inventory policy object. It is composed of policy rules. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema Policy { get; set; } + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + string PolicyDestination { get; set; } + /// Policy is enabled if set to true. + bool? PolicyEnabled { get; set; } + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] PolicyRule { get; set; } + /// The valid value is Inventory + string PolicyType { get; set; } + /// Returns the storage account blob inventory policy rules. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties Property { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.json.cs new file mode 100644 index 000000000000..092ff9f06ce6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicy.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account blob inventory policy. + public partial class BlobInventoryPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobInventoryPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobInventoryPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.PowerShell.cs new file mode 100644 index 000000000000..08361d4c0a6c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.PowerShell.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// An object that defines the blob inventory rule. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyDefinitionTypeConverter))] + public partial class BlobInventoryPolicyDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobInventoryPolicyDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField = (string[]) content.GetValueForProperty("SchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobInventoryPolicyDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Format")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Format = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("Format",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Format, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("Schedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Schedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("Schedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).Schedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("ObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("ObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).ObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("SchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField = (string[]) content.GetValueForProperty("SchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).SchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInventoryPolicyDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInventoryPolicyDefinition(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An object that defines the blob inventory rule. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyDefinitionTypeConverter))] + public partial interface IBlobInventoryPolicyDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.TypeConverter.cs new file mode 100644 index 000000000000..50a031c5df0e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInventoryPolicyDefinitionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInventoryPolicyDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInventoryPolicyDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInventoryPolicyDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.cs new file mode 100644 index 000000000000..be28f4af762c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.cs @@ -0,0 +1,309 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An object that defines the blob inventory rule. + public partial class BlobInventoryPolicyDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter _filter; + + /// An object that defines the filter set. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilter()); set => this._filter = value; } + + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterBlobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).BlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).BlobType = value ?? null /* arrayOf */; } + + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).ExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).ExcludePrefix = value ?? null /* arrayOf */; } + + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FilterIncludeBlobVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).IncludeBlobVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).IncludeBlobVersion = value ?? default(bool); } + + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FilterIncludeDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).IncludeDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).IncludeDeleted = value ?? default(bool); } + + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FilterIncludeSnapshot { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).IncludeSnapshot; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).IncludeSnapshot = value ?? default(bool); } + + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterPrefixMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).PrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)Filter).PrefixMatch = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format _format; + + /// This is a required field, it specifies the format for the inventory files. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format Format { get => this._format; set => this._format = value; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilter()); set { {_filter = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType _objectType; + + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType ObjectType { get => this._objectType; set => this._objectType = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule _schedule; + + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule Schedule { get => this._schedule; set => this._schedule = value; } + + /// Backing field for property. + private string[] _schemaField; + + /// + /// This is a required field. This field specifies the fields and properties of the object to be included in the inventory. + /// The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType + /// include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, + /// AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, + /// Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, + /// LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, + /// ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, + /// CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, + /// TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid + /// values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + /// PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, + /// Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + /// Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid + /// for Non-Hns accounts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] SchemaField { get => this._schemaField; set => this._schemaField = value; } + + /// Creates an new instance. + public BlobInventoryPolicyDefinition() + { + + } + } + /// An object that defines the blob inventory rule. + public partial interface IBlobInventoryPolicyDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is set to 'Blob'.", + SerializedName = @"blobTypes", + PossibleTypes = new [] { typeof(string) })] + string[] FilterBlobType { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings with maximum 10 blob prefixes to be excluded from the inventory.", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] FilterExcludePrefix { get; set; } + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, else they must be excluded.", + SerializedName = @"includeBlobVersions", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIncludeBlobVersion { get; set; } + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be excluded.", + SerializedName = @"includeDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIncludeDeleted { get; set; } + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded.", + SerializedName = @"includeSnapshots", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIncludeSnapshot { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings with maximum 10 blob prefixes to be included in the inventory.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] FilterPrefixMatch { get; set; } + /// This is a required field, it specifies the format for the inventory files. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field, it specifies the format for the inventory files.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format Format { get; set; } + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field. This field specifies the scope of the inventory created either at the blob or container level.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType ObjectType { get; set; } + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field. This field is used to schedule an inventory formation.", + SerializedName = @"schedule", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule Schedule { get; set; } + /// + /// This is a required field. This field specifies the fields and properties of the object to be included in the inventory. + /// The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType + /// include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, + /// AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, + /// Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, + /// LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, + /// ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, + /// CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, + /// TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid + /// values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + /// PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, + /// Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + /// Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid + /// for Non-Hns accounts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field. This field specifies the fields and properties of the object to be included in the inventory. The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts.", + SerializedName = @"schemaFields", + PossibleTypes = new [] { typeof(string) })] + string[] SchemaField { get; set; } + + } + /// An object that defines the blob inventory rule. + internal partial interface IBlobInventoryPolicyDefinitionInternal + + { + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter Filter { get; set; } + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + string[] FilterBlobType { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + string[] FilterExcludePrefix { get; set; } + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + bool? FilterIncludeBlobVersion { get; set; } + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + bool? FilterIncludeDeleted { get; set; } + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + bool? FilterIncludeSnapshot { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + string[] FilterPrefixMatch { get; set; } + /// This is a required field, it specifies the format for the inventory files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format Format { get; set; } + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType ObjectType { get; set; } + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule Schedule { get; set; } + /// + /// This is a required field. This field specifies the fields and properties of the object to be included in the inventory. + /// The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType + /// include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, + /// AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, + /// Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, + /// LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, + /// ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, + /// CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, + /// TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid + /// values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + /// PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, + /// Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + /// Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid + /// for Non-Hns accounts. + /// + string[] SchemaField { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.json.cs new file mode 100644 index 000000000000..9de4be6a33d5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyDefinition.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An object that defines the blob inventory rule. + public partial class BlobInventoryPolicyDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobInventoryPolicyDefinition(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_filter = If( json?.PropertyT("filters"), out var __jsonFilters) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilter.FromJson(__jsonFilters) : Filter;} + {_format = If( json?.PropertyT("format"), out var __jsonFormat) ? (string)__jsonFormat : (string)Format;} + {_schedule = If( json?.PropertyT("schedule"), out var __jsonSchedule) ? (string)__jsonSchedule : (string)Schedule;} + {_objectType = If( json?.PropertyT("objectType"), out var __jsonObjectType) ? (string)__jsonObjectType : (string)ObjectType;} + {_schemaField = If( json?.PropertyT("schemaFields"), out var __jsonSchemaFields) ? If( __jsonSchemaFields as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : SchemaField;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobInventoryPolicyDefinition(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filters" ,container.Add ); + AddIf( null != (((object)this._format)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._format.ToString()) : null, "format" ,container.Add ); + AddIf( null != (((object)this._schedule)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._schedule.ToString()) : null, "schedule" ,container.Add ); + AddIf( null != (((object)this._objectType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectType.ToString()) : null, "objectType" ,container.Add ); + if (null != this._schemaField) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._schemaField ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("schemaFields",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.PowerShell.cs new file mode 100644 index 000000000000..8c6fffa713a1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties + /// are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch + /// is applicable and is optional. + /// + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyFilterTypeConverter))] + public partial class BlobInventoryPolicyFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobInventoryPolicyFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix = (string[]) content.GetValueForProperty("ExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion = (bool?) content.GetValueForProperty("IncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot = (bool?) content.GetValueForProperty("IncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted = (bool?) content.GetValueForProperty("IncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobInventoryPolicyFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix = (string[]) content.GetValueForProperty("ExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).ExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("IncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion = (bool?) content.GetValueForProperty("IncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot = (bool?) content.GetValueForProperty("IncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted = (bool?) content.GetValueForProperty("IncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal)this).IncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInventoryPolicyFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInventoryPolicyFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties + /// are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch + /// is applicable and is optional. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyFilterTypeConverter))] + public partial interface IBlobInventoryPolicyFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.TypeConverter.cs new file mode 100644 index 000000000000..c35796852a2f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInventoryPolicyFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInventoryPolicyFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInventoryPolicyFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInventoryPolicyFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.cs new file mode 100644 index 000000000000..76004c07be91 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties + /// are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch + /// is applicable and is optional. + /// + public partial class BlobInventoryPolicyFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilterInternal + { + + /// Backing field for property. + private string[] _blobType; + + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] BlobType { get => this._blobType; set => this._blobType = value; } + + /// Backing field for property. + private string[] _excludePrefix; + + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] ExcludePrefix { get => this._excludePrefix; set => this._excludePrefix = value; } + + /// Backing field for property. + private bool? _includeBlobVersion; + + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IncludeBlobVersion { get => this._includeBlobVersion; set => this._includeBlobVersion = value; } + + /// Backing field for property. + private bool? _includeDeleted; + + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IncludeDeleted { get => this._includeDeleted; set => this._includeDeleted = value; } + + /// Backing field for property. + private bool? _includeSnapshot; + + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IncludeSnapshot { get => this._includeSnapshot; set => this._includeSnapshot = value; } + + /// Backing field for property. + private string[] _prefixMatch; + + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] PrefixMatch { get => this._prefixMatch; set => this._prefixMatch = value; } + + /// Creates an new instance. + public BlobInventoryPolicyFilter() + { + + } + } + /// An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties + /// are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch + /// is applicable and is optional. + public partial interface IBlobInventoryPolicyFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is set to 'Blob'.", + SerializedName = @"blobTypes", + PossibleTypes = new [] { typeof(string) })] + string[] BlobType { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings with maximum 10 blob prefixes to be excluded from the inventory.", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] ExcludePrefix { get; set; } + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, else they must be excluded.", + SerializedName = @"includeBlobVersions", + PossibleTypes = new [] { typeof(bool) })] + bool? IncludeBlobVersion { get; set; } + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be excluded.", + SerializedName = @"includeDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? IncludeDeleted { get; set; } + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded.", + SerializedName = @"includeSnapshots", + PossibleTypes = new [] { typeof(bool) })] + bool? IncludeSnapshot { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings with maximum 10 blob prefixes to be included in the inventory.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] PrefixMatch { get; set; } + + } + /// An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties + /// are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch + /// is applicable and is optional. + internal partial interface IBlobInventoryPolicyFilterInternal + + { + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + string[] BlobType { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + string[] ExcludePrefix { get; set; } + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + bool? IncludeBlobVersion { get; set; } + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + bool? IncludeDeleted { get; set; } + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + bool? IncludeSnapshot { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + string[] PrefixMatch { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.json.cs new file mode 100644 index 000000000000..33f10d7adb9a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyFilter.json.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// An object that defines the blob inventory rule filter conditions. For 'Blob' definition.objectType all filter properties + /// are applicable, 'blobTypes' is required and others are optional. For 'Container' definition.objectType only prefixMatch + /// is applicable and is optional. + /// + public partial class BlobInventoryPolicyFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobInventoryPolicyFilter(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_prefixMatch = If( json?.PropertyT("prefixMatch"), out var __jsonPrefixMatch) ? If( __jsonPrefixMatch as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : PrefixMatch;} + {_excludePrefix = If( json?.PropertyT("excludePrefix"), out var __jsonExcludePrefix) ? If( __jsonExcludePrefix as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : ExcludePrefix;} + {_blobType = If( json?.PropertyT("blobTypes"), out var __jsonBlobTypes) ? If( __jsonBlobTypes as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : BlobType;} + {_includeBlobVersion = If( json?.PropertyT("includeBlobVersions"), out var __jsonIncludeBlobVersions) ? (bool?)__jsonIncludeBlobVersions : IncludeBlobVersion;} + {_includeSnapshot = If( json?.PropertyT("includeSnapshots"), out var __jsonIncludeSnapshots) ? (bool?)__jsonIncludeSnapshots : IncludeSnapshot;} + {_includeDeleted = If( json?.PropertyT("includeDeleted"), out var __jsonIncludeDeleted) ? (bool?)__jsonIncludeDeleted : IncludeDeleted;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobInventoryPolicyFilter(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._prefixMatch) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._prefixMatch ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("prefixMatch",__w); + } + if (null != this._excludePrefix) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._excludePrefix ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("excludePrefix",__r); + } + if (null != this._blobType) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __n in this._blobType ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("blobTypes",__m); + } + AddIf( null != this._includeBlobVersion ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._includeBlobVersion) : null, "includeBlobVersions" ,container.Add ); + AddIf( null != this._includeSnapshot ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._includeSnapshot) : null, "includeSnapshots" ,container.Add ); + AddIf( null != this._includeDeleted ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._includeDeleted) : null, "includeDeleted" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..b82826c77c64 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The storage account blob inventory policy properties. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyPropertiesTypeConverter))] + public partial class BlobInventoryPolicyProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobInventoryPolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobInventoryPolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled = (bool) content.GetValueForProperty("PolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PolicyDestination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination = (string) content.GetValueForProperty("PolicyDestination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyDestination, global::System.Convert.ToString); + } + if (content.Contains("PolicyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType = (string) content.GetValueForProperty("PolicyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyType, global::System.Convert.ToString); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInventoryPolicyProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInventoryPolicyProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage account blob inventory policy properties. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyPropertiesTypeConverter))] + public partial interface IBlobInventoryPolicyProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..36b0932771c3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInventoryPolicyPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInventoryPolicyProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInventoryPolicyProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInventoryPolicyProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.cs new file mode 100644 index 000000000000..c0c07fb48f4c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account blob inventory policy properties. + public partial class BlobInventoryPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Returns the last modified date and time of the blob inventory policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchema()); set { {_policy = value;} } } + + /// Internal Acessors for PolicyDestination + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal.PolicyDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Destination; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Destination = value; } + + /// Internal Acessors for PolicyType + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyPropertiesInternal.PolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema _policy; + + /// + /// The storage account blob inventory policy object. It is composed of policy rules. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchema()); set => this._policy = value; } + + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PolicyDestination { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Destination; } + + /// Policy is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool PolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Enabled = value ; } + + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Rule = value ; } + + /// The valid value is Inventory + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PolicyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)Policy).Type; } + + /// Creates an new instance. + public BlobInventoryPolicyProperties() + { + + } + } + /// The storage account blob inventory policy properties. + public partial interface IBlobInventoryPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Returns the last modified date and time of the blob inventory policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the last modified date and time of the blob inventory policy.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at the rule level 'policy.rule.destination'", + SerializedName = @"destination", + PossibleTypes = new [] { typeof(string) })] + string PolicyDestination { get; } + /// Policy is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Policy is enabled if set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool PolicyEnabled { get; set; } + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account blob inventory policy rules. The rule is applied when it is enabled.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] PolicyRule { get; set; } + /// The valid value is Inventory + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The valid value is Inventory", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string PolicyType { get; } + + } + /// The storage account blob inventory policy properties. + internal partial interface IBlobInventoryPolicyPropertiesInternal + + { + /// Returns the last modified date and time of the blob inventory policy. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// The storage account blob inventory policy object. It is composed of policy rules. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema Policy { get; set; } + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + string PolicyDestination { get; set; } + /// Policy is enabled if set to true. + bool PolicyEnabled { get; set; } + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] PolicyRule { get; set; } + /// The valid value is Inventory + string PolicyType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.json.cs new file mode 100644 index 000000000000..502a239cd43c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyProperties.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account blob inventory policy properties. + public partial class BlobInventoryPolicyProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobInventoryPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicySchema.FromJson(__jsonPolicy) : Policy;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobInventoryPolicyProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._policy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._policy.ToJson(null,serializationMode) : null, "policy" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.PowerShell.cs new file mode 100644 index 000000000000..fa7f5b6744cd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.PowerShell.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + /// + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyRuleTypeConverter))] + public partial class BlobInventoryPolicyRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobInventoryPolicyRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("DefinitionFormat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("DefinitionSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("DefinitionSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("DefinitionObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("DefinitionObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionSchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField = (string[]) content.GetValueForProperty("DefinitionSchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobInventoryPolicyRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFormat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) content.GetValueForProperty("DefinitionFormat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFormat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format.CreateFrom); + } + if (content.Contains("DefinitionSchedule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) content.GetValueForProperty("DefinitionSchedule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchedule, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule.CreateFrom); + } + if (content.Contains("DefinitionObjectType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) content.GetValueForProperty("DefinitionObjectType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionObjectType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType.CreateFrom); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionSchemaField")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField = (string[]) content.GetValueForProperty("DefinitionSchemaField",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).DefinitionSchemaField, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterExcludePrefix")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix = (string[]) content.GetValueForProperty("FilterExcludePrefix",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterExcludePrefix, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterIncludeBlobVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion = (bool?) content.GetValueForProperty("FilterIncludeBlobVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeBlobVersion, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeSnapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot = (bool?) content.GetValueForProperty("FilterIncludeSnapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeSnapshot, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FilterIncludeDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted = (bool?) content.GetValueForProperty("FilterIncludeDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal)this).FilterIncludeDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInventoryPolicyRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInventoryPolicyRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicyRuleTypeConverter))] + public partial interface IBlobInventoryPolicyRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.TypeConverter.cs new file mode 100644 index 000000000000..3b87556a9dac --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInventoryPolicyRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInventoryPolicyRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInventoryPolicyRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInventoryPolicyRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.cs new file mode 100644 index 000000000000..e7b6e7256218 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.cs @@ -0,0 +1,364 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + /// + public partial class BlobInventoryPolicyRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition _definition; + + /// An object that defines the blob inventory policy rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyDefinition()); set => this._definition = value; } + + /// This is a required field, it specifies the format for the inventory files. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format DefinitionFormat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).Format; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).Format = value ; } + + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType DefinitionObjectType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).ObjectType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).ObjectType = value ; } + + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule DefinitionSchedule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).Schedule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).Schedule = value ; } + + /// + /// This is a required field. This field specifies the fields and properties of the object to be included in the inventory. + /// The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType + /// include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, + /// AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, + /// Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, + /// LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, + /// ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, + /// CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, + /// TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid + /// values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + /// PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, + /// Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + /// Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid + /// for Non-Hns accounts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] DefinitionSchemaField { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).SchemaField; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).SchemaField = value ; } + + /// Backing field for property. + private string _destination; + + /// Container name where blob inventory files are stored. Must be pre-created. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Destination { get => this._destination; set => this._destination = value; } + + /// Backing field for property. + private bool _enabled; + + /// Rule is enabled when set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterBlobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterBlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterBlobType = value ?? null /* arrayOf */; } + + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterExcludePrefix { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterExcludePrefix; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterExcludePrefix = value ?? null /* arrayOf */; } + + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FilterIncludeBlobVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeBlobVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeBlobVersion = value ?? default(bool); } + + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FilterIncludeDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeDeleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeDeleted = value ?? default(bool); } + + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FilterIncludeSnapshot { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeSnapshot; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterIncludeSnapshot = value ?? default(bool); } + + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterPrefixMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterPrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).FilterPrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyDefinition()); set { {_definition = value;} } } + + /// Internal Acessors for DefinitionFilter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRuleInternal.DefinitionFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinitionInternal)Definition).Filter = value; } + + /// Backing field for property. + private string _name; + + /// + /// A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within + /// a policy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public BlobInventoryPolicyRule() + { + + } + } + /// An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + public partial interface IBlobInventoryPolicyRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// This is a required field, it specifies the format for the inventory files. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field, it specifies the format for the inventory files.", + SerializedName = @"format", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format DefinitionFormat { get; set; } + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field. This field specifies the scope of the inventory created either at the blob or container level.", + SerializedName = @"objectType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType DefinitionObjectType { get; set; } + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field. This field is used to schedule an inventory formation.", + SerializedName = @"schedule", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule DefinitionSchedule { get; set; } + /// + /// This is a required field. This field specifies the fields and properties of the object to be included in the inventory. + /// The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType + /// include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, + /// AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, + /// Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, + /// LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, + /// ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, + /// CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, + /// TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid + /// values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + /// PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, + /// Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + /// Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid + /// for Non-Hns accounts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is a required field. This field specifies the fields and properties of the object to be included in the inventory. The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid for Non-Hns accounts.", + SerializedName = @"schemaFields", + PossibleTypes = new [] { typeof(string) })] + string[] DefinitionSchemaField { get; set; } + /// Container name where blob inventory files are stored. Must be pre-created. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Container name where blob inventory files are stored. Must be pre-created.", + SerializedName = @"destination", + PossibleTypes = new [] { typeof(string) })] + string Destination { get; set; } + /// Rule is enabled when set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Rule is enabled when set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support pageBlobs. This field is required when definition.objectType property is set to 'Blob'.", + SerializedName = @"blobTypes", + PossibleTypes = new [] { typeof(string) })] + string[] FilterBlobType { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings with maximum 10 blob prefixes to be excluded from the inventory.", + SerializedName = @"excludePrefix", + PossibleTypes = new [] { typeof(string) })] + string[] FilterExcludePrefix { get; set; } + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and IsCurrentVersion' are required if this property is set to true, else they must be excluded.", + SerializedName = @"includeBlobVersions", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIncludeBlobVersion { get; set; } + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include 'Deleted and RemainingRetentionDays', else it must be excluded.", + SerializedName = @"includeDeleted", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIncludeDeleted { get; set; } + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required if this property is set to true, else it must be excluded.", + SerializedName = @"includeSnapshots", + PossibleTypes = new [] { typeof(bool) })] + bool? FilterIncludeSnapshot { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings with maximum 10 blob prefixes to be included in the inventory.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] FilterPrefixMatch { get; set; } + /// + /// A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within + /// a policy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + internal partial interface IBlobInventoryPolicyRuleInternal + + { + /// An object that defines the blob inventory policy rule. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyDefinition Definition { get; set; } + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyFilter DefinitionFilter { get; set; } + /// This is a required field, it specifies the format for the inventory files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format DefinitionFormat { get; set; } + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType DefinitionObjectType { get; set; } + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule DefinitionSchedule { get; set; } + /// + /// This is a required field. This field specifies the fields and properties of the object to be included in the inventory. + /// The Schema field value 'Name' is always required. The valid values for this field for the 'Blob' definition.objectType + /// include 'Name, Creation-Time, Last-Modified, Content-Length, Content-MD5, BlobType, AccessTier, AccessTierChangeTime, + /// AccessTierInferred, Tags, Expiry-Time, hdi_isfolder, Owner, Group, Permissions, Acl, Snapshot, VersionId, IsCurrentVersion, + /// Metadata, LastAccessTime, Tags, Etag, ContentType, ContentEncoding, ContentLanguage, ContentCRC64, CacheControl, ContentDisposition, + /// LeaseStatus, LeaseState, LeaseDuration, ServerEncrypted, Deleted, DeletionId, DeletedTime, RemainingRetentionDays, ImmutabilityPolicyUntilDate, + /// ImmutabilityPolicyMode, LegalHold, CopyId, CopyStatus, CopySource, CopyProgress, CopyCompletionTime, CopyStatusDescription, + /// CustomerProvidedKeySha256, RehydratePriority, ArchiveStatus, XmsBlobSequenceNumber, EncryptionScope, IncrementalCopy, + /// TagCount'. For Blob object type schema field value 'DeletedTime' is applicable only for Hns enabled accounts. The valid + /// values for 'Container' definition.objectType include 'Name, Last-Modified, Metadata, LeaseStatus, LeaseState, LeaseDuration, + /// PublicAccess, HasImmutabilityPolicy, HasLegalHold, Etag, DefaultEncryptionScope, DenyEncryptionScopeOverride, ImmutableStorageWithVersioningEnabled, + /// Deleted, Version, DeletedTime, RemainingRetentionDays'. Schema field values 'Expiry-Time, hdi_isfolder, Owner, Group, + /// Permissions, Acl, DeletionId' are valid only for Hns enabled accounts.Schema field values 'Tags, TagCount' are only valid + /// for Non-Hns accounts. + /// + string[] DefinitionSchemaField { get; set; } + /// Container name where blob inventory files are stored. Must be pre-created. + string Destination { get; set; } + /// Rule is enabled when set to true. + bool Enabled { get; set; } + /// + /// An array of predefined enum values. Valid values include blockBlob, appendBlob, pageBlob. Hns accounts does not support + /// pageBlobs. This field is required when definition.objectType property is set to 'Blob'. + /// + string[] FilterBlobType { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be excluded from the inventory. + /// + string[] FilterExcludePrefix { get; set; } + /// + /// Includes blob versions in blob inventory when value is set to true. The definition.schemaFields values 'VersionId and + /// IsCurrentVersion' are required if this property is set to true, else they must be excluded. + /// + bool? FilterIncludeBlobVersion { get; set; } + /// + /// For 'Container' definition.objectType the definition.schemaFields must include 'Deleted, Version, DeletedTime and RemainingRetentionDays'. + /// For 'Blob' definition.objectType and HNS enabled storage accounts the definition.schemaFields must include 'DeletionId, + /// Deleted, DeletedTime and RemainingRetentionDays' and for Hns disabled accounts the definition.schemaFields must include + /// 'Deleted and RemainingRetentionDays', else it must be excluded. + /// + bool? FilterIncludeDeleted { get; set; } + /// + /// Includes blob snapshots in blob inventory when value is set to true. The definition.schemaFields value 'Snapshot' is required + /// if this property is set to true, else it must be excluded. + /// + bool? FilterIncludeSnapshot { get; set; } + /// + /// An array of strings with maximum 10 blob prefixes to be included in the inventory. + /// + string[] FilterPrefixMatch { get; set; } + /// + /// A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within + /// a policy. + /// + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.json.cs new file mode 100644 index 000000000000..084590e54b95 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicyRule.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// An object that wraps the blob inventory rule. Each rule is uniquely defined by name. + /// + public partial class BlobInventoryPolicyRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobInventoryPolicyRule(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyDefinition.FromJson(__jsonDefinition) : Definition;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? (string)__jsonDestination : (string)Destination;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobInventoryPolicyRule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._definition ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._definition.ToJson(null,serializationMode) : null, "definition" ,container.Add ); + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._destination)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._destination.ToString()) : null, "destination" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.PowerShell.cs new file mode 100644 index 000000000000..135e1a0745d0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The storage account blob inventory policy rules. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicySchemaTypeConverter))] + public partial class BlobInventoryPolicySchema + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobInventoryPolicySchema(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobInventoryPolicySchema(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Destination")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Destination = (string) content.GetValueForProperty("Destination",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Destination, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobInventoryPolicySchema(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobInventoryPolicySchema(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage account blob inventory policy rules. + [System.ComponentModel.TypeConverter(typeof(BlobInventoryPolicySchemaTypeConverter))] + public partial interface IBlobInventoryPolicySchema + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.TypeConverter.cs new file mode 100644 index 000000000000..9888d2118dec --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobInventoryPolicySchemaTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobInventoryPolicySchema.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobInventoryPolicySchema.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobInventoryPolicySchema.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.cs new file mode 100644 index 000000000000..bacad62143e2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account blob inventory policy rules. + public partial class BlobInventoryPolicySchema : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal + { + + /// Backing field for property. + private string _destination; + + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Destination { get => this._destination; } + + /// Backing field for property. + private bool _enabled; + + /// Policy is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// Internal Acessors for Destination + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal.Destination { get => this._destination; set { {_destination = value;} } } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchemaInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] _rule; + + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] Rule { get => this._rule; set => this._rule = value; } + + /// Backing field for property. + private string _type= @"Inventory"; + + /// The valid value is Inventory + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public BlobInventoryPolicySchema() + { + + } + } + /// The storage account blob inventory policy rules. + public partial interface IBlobInventoryPolicySchema : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at the rule level 'policy.rule.destination'", + SerializedName = @"destination", + PossibleTypes = new [] { typeof(string) })] + string Destination { get; } + /// Policy is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Policy is enabled if set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account blob inventory policy rules. The rule is applied when it is enabled.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] Rule { get; set; } + /// The valid value is Inventory + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The valid value is Inventory", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The storage account blob inventory policy rules. + internal partial interface IBlobInventoryPolicySchemaInternal + + { + /// + /// Deprecated Property from API version 2021-04-01 onwards, the required destination container name must be specified at + /// the rule level 'policy.rule.destination' + /// + string Destination { get; set; } + /// Policy is enabled if set to true. + bool Enabled { get; set; } + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] Rule { get; set; } + /// The valid value is Inventory + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.json.cs new file mode 100644 index 000000000000..e87ca07941de --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobInventoryPolicySchema.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account blob inventory policy rules. + public partial class BlobInventoryPolicySchema + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobInventoryPolicySchema(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_destination = If( json?.PropertyT("destination"), out var __jsonDestination) ? (string)__jsonDestination : (string)Destination;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyRule.FromJson(__u) )) ))() : null : Rule;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicySchema FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobInventoryPolicySchema(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._destination)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._destination.ToString()) : null, "destination" ,container.Add ); + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + if (null != this._rule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._rule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("rules",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.PowerShell.cs new file mode 100644 index 000000000000..398293e05f4d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Blob restore parameters + [System.ComponentModel.TypeConverter(typeof(BlobRestoreParametersTypeConverter))] + public partial class BlobRestoreParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobRestoreParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).TimeToRestore = (global::System.DateTime) content.GetValueForProperty("TimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).TimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).BlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("BlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).BlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobRestoreParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).TimeToRestore = (global::System.DateTime) content.GetValueForProperty("TimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).TimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("BlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).BlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("BlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)this).BlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobRestoreParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobRestoreParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Blob restore parameters + [System.ComponentModel.TypeConverter(typeof(BlobRestoreParametersTypeConverter))] + public partial interface IBlobRestoreParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.TypeConverter.cs new file mode 100644 index 000000000000..e1cd66bab3f5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobRestoreParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobRestoreParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobRestoreParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobRestoreParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.cs new file mode 100644 index 000000000000..2a9b8d99a4ed --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob restore parameters + public partial class BlobRestoreParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] _blobRange; + + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] BlobRange { get => this._blobRange; set => this._blobRange = value; } + + /// Backing field for property. + private global::System.DateTime _timeToRestore; + + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime TimeToRestore { get => this._timeToRestore; set => this._timeToRestore = value; } + + /// Creates an new instance. + public BlobRestoreParameters() + { + + } + } + /// Blob restore parameters + public partial interface IBlobRestoreParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob ranges to restore.", + SerializedName = @"blobRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] BlobRange { get; set; } + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Restore blob to the specified time.", + SerializedName = @"timeToRestore", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime TimeToRestore { get; set; } + + } + /// Blob restore parameters + internal partial interface IBlobRestoreParametersInternal + + { + /// Blob ranges to restore. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] BlobRange { get; set; } + /// Restore blob to the specified time. + global::System.DateTime TimeToRestore { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.json.cs new file mode 100644 index 000000000000..931eb822f232 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreParameters.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob restore parameters + public partial class BlobRestoreParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobRestoreParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_timeToRestore = If( json?.PropertyT("timeToRestore"), out var __jsonTimeToRestore) ? global::System.DateTime.TryParse((string)__jsonTimeToRestore, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeToRestoreValue) ? __jsonTimeToRestoreValue : TimeToRestore : TimeToRestore;} + {_blobRange = If( json?.PropertyT("blobRanges"), out var __jsonBlobRanges) ? If( __jsonBlobRanges as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRange.FromJson(__u) )) ))() : null : BlobRange;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobRestoreParameters(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._timeToRestore.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)), "timeToRestore" ,container.Add ); + if (null != this._blobRange) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._blobRange ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("blobRanges",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.PowerShell.cs new file mode 100644 index 000000000000..189d583c441d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Blob range + [System.ComponentModel.TypeConverter(typeof(BlobRestoreRangeTypeConverter))] + public partial class BlobRestoreRange + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobRestoreRange(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).StartRange = (string) content.GetValueForProperty("StartRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).StartRange, global::System.Convert.ToString); + } + if (content.Contains("EndRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).EndRange = (string) content.GetValueForProperty("EndRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).EndRange, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobRestoreRange(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).StartRange = (string) content.GetValueForProperty("StartRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).StartRange, global::System.Convert.ToString); + } + if (content.Contains("EndRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).EndRange = (string) content.GetValueForProperty("EndRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal)this).EndRange, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobRestoreRange(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobRestoreRange(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Blob range + [System.ComponentModel.TypeConverter(typeof(BlobRestoreRangeTypeConverter))] + public partial interface IBlobRestoreRange + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.TypeConverter.cs new file mode 100644 index 000000000000..4047a407052e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobRestoreRangeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobRestoreRange.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobRestoreRange.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobRestoreRange.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.cs new file mode 100644 index 000000000000..c0285d114224 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob range + public partial class BlobRestoreRange : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRangeInternal + { + + /// Backing field for property. + private string _endRange; + + /// Blob end range. This is exclusive. Empty means account end. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string EndRange { get => this._endRange; set => this._endRange = value; } + + /// Backing field for property. + private string _startRange; + + /// Blob start range. This is inclusive. Empty means account start. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string StartRange { get => this._startRange; set => this._startRange = value; } + + /// Creates an new instance. + public BlobRestoreRange() + { + + } + } + /// Blob range + public partial interface IBlobRestoreRange : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Blob end range. This is exclusive. Empty means account end. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob end range. This is exclusive. Empty means account end.", + SerializedName = @"endRange", + PossibleTypes = new [] { typeof(string) })] + string EndRange { get; set; } + /// Blob start range. This is inclusive. Empty means account start. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob start range. This is inclusive. Empty means account start.", + SerializedName = @"startRange", + PossibleTypes = new [] { typeof(string) })] + string StartRange { get; set; } + + } + /// Blob range + internal partial interface IBlobRestoreRangeInternal + + { + /// Blob end range. This is exclusive. Empty means account end. + string EndRange { get; set; } + /// Blob start range. This is inclusive. Empty means account start. + string StartRange { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.json.cs new file mode 100644 index 000000000000..f199e3bdbf84 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreRange.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob range + public partial class BlobRestoreRange + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobRestoreRange(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startRange = If( json?.PropertyT("startRange"), out var __jsonStartRange) ? (string)__jsonStartRange : (string)StartRange;} + {_endRange = If( json?.PropertyT("endRange"), out var __jsonEndRange) ? (string)__jsonEndRange : (string)EndRange;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobRestoreRange(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._startRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startRange.ToString()) : null, "startRange" ,container.Add ); + AddIf( null != (((object)this._endRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._endRange.ToString()) : null, "endRange" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.PowerShell.cs new file mode 100644 index 000000000000..4b43f7cc2ce2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Blob restore status. + [System.ComponentModel.TypeConverter(typeof(BlobRestoreStatusTypeConverter))] + public partial class BlobRestoreStatus + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobRestoreStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("RestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).RestoreId = (string) content.GetValueForProperty("RestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).RestoreId, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterTimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterBlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobRestoreStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Parameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Parameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) content.GetValueForProperty("Parameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Parameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("FailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).FailureReason = (string) content.GetValueForProperty("FailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).FailureReason, global::System.Convert.ToString); + } + if (content.Contains("RestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).RestoreId = (string) content.GetValueForProperty("RestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).RestoreId, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterTimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterBlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobRestoreStatus(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobRestoreStatus(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Blob restore status. + [System.ComponentModel.TypeConverter(typeof(BlobRestoreStatusTypeConverter))] + public partial interface IBlobRestoreStatus + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.TypeConverter.cs new file mode 100644 index 000000000000..8a4034983223 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobRestoreStatusTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobRestoreStatus.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobRestoreStatus.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobRestoreStatus.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.cs new file mode 100644 index 000000000000..c207c93548fb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob restore status. + public partial class BlobRestoreStatus : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal + { + + /// Backing field for property. + private string _failureReason; + + /// Failure reason when blob restore is failed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string FailureReason { get => this._failureReason; } + + /// Internal Acessors for FailureReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal.FailureReason { get => this._failureReason; set { {_failureReason = value;} } } + + /// Internal Acessors for Parameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal.Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParameters()); set { {_parameter = value;} } } + + /// Internal Acessors for RestoreId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal.RestoreId { get => this._restoreId; set { {_restoreId = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal.Status { get => this._status; set { {_status = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters _parameter; + + /// Blob restore request parameters. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters Parameter { get => (this._parameter = this._parameter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParameters()); } + + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)Parameter).BlobRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)Parameter).BlobRange = value ?? null /* arrayOf */; } + + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterTimeToRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)Parameter).TimeToRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParametersInternal)Parameter).TimeToRestore = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _restoreId; + + /// Id for tracking blob restore request. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string RestoreId { get => this._restoreId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? _status; + + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Status { get => this._status; } + + /// Creates an new instance. + public BlobRestoreStatus() + { + + } + } + /// Blob restore status. + public partial interface IBlobRestoreStatus : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Failure reason when blob restore is failed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Failure reason when blob restore is failed.", + SerializedName = @"failureReason", + PossibleTypes = new [] { typeof(string) })] + string FailureReason { get; } + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob ranges to restore.", + SerializedName = @"blobRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get; set; } + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restore blob to the specified time.", + SerializedName = @"timeToRestore", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterTimeToRestore { get; set; } + /// Id for tracking blob restore request. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Id for tracking blob restore request.", + SerializedName = @"restoreId", + PossibleTypes = new [] { typeof(string) })] + string RestoreId { get; } + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Status { get; } + + } + /// Blob restore status. + internal partial interface IBlobRestoreStatusInternal + + { + /// Failure reason when blob restore is failed. + string FailureReason { get; set; } + /// Blob restore request parameters. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters Parameter { get; set; } + /// Blob ranges to restore. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get; set; } + /// Restore blob to the specified time. + global::System.DateTime? ParameterTimeToRestore { get; set; } + /// Id for tracking blob restore request. + string RestoreId { get; set; } + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.json.cs new file mode 100644 index 000000000000..f1723be55b5d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobRestoreStatus.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob restore status. + public partial class BlobRestoreStatus + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobRestoreStatus(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_parameter = If( json?.PropertyT("parameters"), out var __jsonParameters) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParameters.FromJson(__jsonParameters) : Parameter;} + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_failureReason = If( json?.PropertyT("failureReason"), out var __jsonFailureReason) ? (string)__jsonFailureReason : (string)FailureReason;} + {_restoreId = If( json?.PropertyT("restoreId"), out var __jsonRestoreId) ? (string)__jsonRestoreId : (string)RestoreId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobRestoreStatus(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._parameter ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._parameter.ToJson(null,serializationMode) : null, "parameters" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._failureReason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._failureReason.ToString()) : null, "failureReason" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._restoreId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._restoreId.ToString()) : null, "restoreId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.PowerShell.cs new file mode 100644 index 000000000000..021e7d2879d7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(BlobServiceItemsTypeConverter))] + public partial class BlobServiceItems + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobServiceItems(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobServiceItems(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobServiceItems(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobServiceItems(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(BlobServiceItemsTypeConverter))] + public partial interface IBlobServiceItems + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.TypeConverter.cs new file mode 100644 index 000000000000..d42806cadef0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobServiceItemsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobServiceItems.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobServiceItems.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobServiceItems.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.cs new file mode 100644 index 000000000000..209140cf43a1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class BlobServiceItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItemsInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItemsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties[] _value; + + /// List of blob services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties[] Value { get => this._value; } + + /// Creates an new instance. + public BlobServiceItems() + { + + } + } + public partial interface IBlobServiceItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of blob services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of blob services returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties[] Value { get; } + + } + internal partial interface IBlobServiceItemsInternal + + { + /// List of blob services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.json.cs new file mode 100644 index 000000000000..4d37d2d2443b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceItems.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class BlobServiceItems + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobServiceItems(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServiceProperties.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobServiceItems(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..970fa540af02 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a storage account’s Blob service. + [System.ComponentModel.TypeConverter(typeof(BlobServicePropertiesTypeConverter))] + public partial class BlobServiceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobServiceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("BlobServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).BlobServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated) content.GetValueForProperty("BlobServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).BlobServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobServiceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("BlobServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).BlobServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated) content.GetValueForProperty("BlobServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).BlobServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobServiceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobServiceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a storage account’s Blob service. + [System.ComponentModel.TypeConverter(typeof(BlobServicePropertiesTypeConverter))] + public partial interface IBlobServiceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..e3440ea925ee --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobServicePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobServiceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobServiceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobServiceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.cs new file mode 100644 index 000000000000..f477d9670cb7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Blob service. + public partial class BlobServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated _blobServiceProperty; + + /// The properties of a storage account’s Blob service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated BlobServiceProperty { get => (this._blobServiceProperty = this._blobServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesAutoGenerated()); set => this._blobServiceProperty = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku _sku; + + /// Sku name and tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); } + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public BlobServiceProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The properties of a storage account’s Blob service. + public partial interface IBlobServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// The properties of a storage account’s Blob service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The properties of a storage account’s Blob service.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated BlobServiceProperty { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; } + + } + /// The properties of a storage account’s Blob service. + internal partial interface IBlobServicePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// The properties of a storage account’s Blob service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated BlobServiceProperty { get; set; } + /// Sku name and tier. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.json.cs new file mode 100644 index 000000000000..8e79857f1f89 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServiceProperties.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Blob service. + public partial class BlobServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku.FromJson(__jsonSku) : Sku;} + {_blobServiceProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServicePropertiesAutoGenerated.FromJson(__jsonProperties) : BlobServiceProperty;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobServiceProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + } + AddIf( null != this._blobServiceProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._blobServiceProperty.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..c228f578f36c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.PowerShell.cs @@ -0,0 +1,348 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a storage account’s Blob service. + [System.ComponentModel.TypeConverter(typeof(BlobServicePropertiesAutoGeneratedTypeConverter))] + public partial class BlobServicePropertiesAutoGenerated + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal BlobServicePropertiesAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("DeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("DeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ChangeFeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed) content.GetValueForProperty("ChangeFeed",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ChangeFeedTypeConverter.ConvertFrom); + } + if (content.Contains("RestorePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties) content.GetValueForProperty("RestorePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestorePolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("ContainerDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy) content.GetValueForProperty("LastAccessTimeTrackingPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LastAccessTimeTrackingPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultServiceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion = (string) content.GetValueForProperty("DefaultServiceVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion, global::System.Convert.ToString); + } + if (content.Contains("IsVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled = (bool?) content.GetValueForProperty("IsVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutomaticSnapshotPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled = (bool?) content.GetValueForProperty("AutomaticSnapshotPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay = (int?) content.GetValueForProperty("DeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastAccessTimeTrackingPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("LastAccessTimeTrackingPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicyBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType = (string[]) content.GetValueForProperty("LastAccessTimeTrackingPolicyBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("DeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("DeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled = (bool?) content.GetValueForProperty("ChangeFeedEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedRetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay = (int?) content.GetValueForProperty("ChangeFeedRetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled = (bool) content.GetValueForProperty("RestorePolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestorePolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay = (int?) content.GetValueForProperty("RestorePolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RestorePolicyMinRestoreTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyMinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyMinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyMinRestoreTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ContainerDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ContainerDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ContainerDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyEnable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable = (bool) content.GetValueForProperty("LastAccessTimeTrackingPolicyEnable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyTrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyTrackingGranularityInDay = (int?) content.GetValueForProperty("LastAccessTimeTrackingPolicyTrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyTrackingGranularityInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal BlobServicePropertiesAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("DeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("DeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ChangeFeed")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed) content.GetValueForProperty("ChangeFeed",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeed, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ChangeFeedTypeConverter.ConvertFrom); + } + if (content.Contains("RestorePolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties) content.GetValueForProperty("RestorePolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestorePolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ContainerDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("ContainerDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy) content.GetValueForProperty("LastAccessTimeTrackingPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LastAccessTimeTrackingPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("DefaultServiceVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion = (string) content.GetValueForProperty("DefaultServiceVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DefaultServiceVersion, global::System.Convert.ToString); + } + if (content.Contains("IsVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled = (bool?) content.GetValueForProperty("IsVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).IsVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AutomaticSnapshotPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled = (bool?) content.GetValueForProperty("AutomaticSnapshotPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).AutomaticSnapshotPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay = (int?) content.GetValueForProperty("DeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastAccessTimeTrackingPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("LastAccessTimeTrackingPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("LastAccessTimeTrackingPolicyBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType = (string[]) content.GetValueForProperty("LastAccessTimeTrackingPolicyBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("DeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("DeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("DeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).DeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled = (bool?) content.GetValueForProperty("ChangeFeedEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ChangeFeedRetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay = (int?) content.GetValueForProperty("ChangeFeedRetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ChangeFeedRetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled = (bool) content.GetValueForProperty("RestorePolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RestorePolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay = (int?) content.GetValueForProperty("RestorePolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RestorePolicyLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RestorePolicyMinRestoreTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyMinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("RestorePolicyMinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).RestorePolicyMinRestoreTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ContainerDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ContainerDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ContainerDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ContainerDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ContainerDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).ContainerDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyEnable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable = (bool) content.GetValueForProperty("LastAccessTimeTrackingPolicyEnable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyEnable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastAccessTimeTrackingPolicyTrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyTrackingGranularityInDay = (int?) content.GetValueForProperty("LastAccessTimeTrackingPolicyTrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal)this).LastAccessTimeTrackingPolicyTrackingGranularityInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new BlobServicePropertiesAutoGenerated(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new BlobServicePropertiesAutoGenerated(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a storage account’s Blob service. + [System.ComponentModel.TypeConverter(typeof(BlobServicePropertiesAutoGeneratedTypeConverter))] + public partial interface IBlobServicePropertiesAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..844d9aa5fe99 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class BlobServicePropertiesAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return BlobServicePropertiesAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return BlobServicePropertiesAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return BlobServicePropertiesAutoGenerated.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..26144662a9db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.cs @@ -0,0 +1,494 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Blob service. + public partial class BlobServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal + { + + /// Backing field for property. + private bool? _automaticSnapshotPolicyEnabled; + + /// Deprecated in favor of isVersioningEnabled property. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AutomaticSnapshotPolicyEnabled { get => this._automaticSnapshotPolicyEnabled; set => this._automaticSnapshotPolicyEnabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed _changeFeed; + + /// The blob service properties for change feed events. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed ChangeFeed { get => (this._changeFeed = this._changeFeed ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ChangeFeed()); set => this._changeFeed = value; } + + /// Indicates whether change feed event logging is enabled for the Blob service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ChangeFeedEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)ChangeFeed).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)ChangeFeed).Enabled = value ?? default(bool); } + + /// + /// Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). + /// A null value indicates an infinite retention of the change feed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ChangeFeedRetentionInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)ChangeFeed).RetentionInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)ChangeFeed).RetentionInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy _containerDeleteRetentionPolicy; + + /// The blob service properties for container soft delete. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy ContainerDeleteRetentionPolicy { get => (this._containerDeleteRetentionPolicy = this._containerDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy()); set => this._containerDeleteRetentionPolicy = value; } + + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ContainerDeleteRetentionPolicyAllowPermanentDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).AllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).AllowPermanentDelete = value ?? default(bool); } + + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ContainerDeleteRetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).Day = value ?? default(int); } + + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ContainerDeleteRetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ContainerDeleteRetentionPolicy).Enabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules _cor; + + /// + /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set => this._cor = value; } + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private string _defaultServiceVersion; + + /// + /// DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version + /// is not specified. Possible values include version 2008-10-27 and all more recent versions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DefaultServiceVersion { get => this._defaultServiceVersion; set => this._defaultServiceVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy _deleteRetentionPolicy; + + /// The blob service properties for blob soft delete. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy DeleteRetentionPolicy { get => (this._deleteRetentionPolicy = this._deleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy()); set => this._deleteRetentionPolicy = value; } + + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? DeleteRetentionPolicyAllowPermanentDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).AllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).AllowPermanentDelete = value ?? default(bool); } + + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? DeleteRetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).Day = value ?? default(int); } + + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? DeleteRetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)DeleteRetentionPolicy).Enabled = value ?? default(bool); } + + /// Backing field for property. + private bool? _isVersioningEnabled; + + /// Versioning is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsVersioningEnabled { get => this._isVersioningEnabled; set => this._isVersioningEnabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy _lastAccessTimeTrackingPolicy; + + /// The blob service property to configure last access time based tracking policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy { get => (this._lastAccessTimeTrackingPolicy = this._lastAccessTimeTrackingPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LastAccessTimeTrackingPolicy()); set => this._lastAccessTimeTrackingPolicy = value; } + + /// + /// An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] LastAccessTimeTrackingPolicyBlobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).BlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).BlobType = value ?? null /* arrayOf */; } + + /// When set to true last access time based tracking is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? LastAccessTimeTrackingPolicyEnable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).Enable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).Enable = value ?? default(bool); } + + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name? LastAccessTimeTrackingPolicyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name)""); } + + /// + /// The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This + /// field is currently read only with value as 1 + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? LastAccessTimeTrackingPolicyTrackingGranularityInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).TrackingGranularityInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)LastAccessTimeTrackingPolicy).TrackingGranularityInDay = value ?? default(int); } + + /// Internal Acessors for ChangeFeed + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.ChangeFeed { get => (this._changeFeed = this._changeFeed ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ChangeFeed()); set { {_changeFeed = value;} } } + + /// Internal Acessors for ContainerDeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.ContainerDeleteRetentionPolicy { get => (this._containerDeleteRetentionPolicy = this._containerDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy()); set { {_containerDeleteRetentionPolicy = value;} } } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set { {_cor = value;} } } + + /// Internal Acessors for DeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.DeleteRetentionPolicy { get => (this._deleteRetentionPolicy = this._deleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy()); set { {_deleteRetentionPolicy = value;} } } + + /// Internal Acessors for LastAccessTimeTrackingPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.LastAccessTimeTrackingPolicy { get => (this._lastAccessTimeTrackingPolicy = this._lastAccessTimeTrackingPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LastAccessTimeTrackingPolicy()); set { {_lastAccessTimeTrackingPolicy = value;} } } + + /// Internal Acessors for RestorePolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.RestorePolicy { get => (this._restorePolicy = this._restorePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestorePolicyProperties()); set { {_restorePolicy = value;} } } + + /// Internal Acessors for RestorePolicyLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.RestorePolicyLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).LastEnabledTime = value; } + + /// Internal Acessors for RestorePolicyMinRestoreTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGeneratedInternal.RestorePolicyMinRestoreTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).MinRestoreTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).MinRestoreTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties _restorePolicy; + + /// The blob service properties for blob restore policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties RestorePolicy { get => (this._restorePolicy = this._restorePolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestorePolicyProperties()); set => this._restorePolicy = value; } + + /// + /// how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? RestorePolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).Day = value ?? default(int); } + + /// Blob restore is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RestorePolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).Enabled = value ?? default(bool); } + + /// Deprecated in favor of minRestoreTime property. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? RestorePolicyLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).LastEnabledTime; } + + /// Returns the minimum date and time that the restore can be started. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? RestorePolicyMinRestoreTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)RestorePolicy).MinRestoreTime; } + + /// Creates an new instance. + public BlobServicePropertiesAutoGenerated() + { + + } + } + /// The properties of a storage account’s Blob service. + public partial interface IBlobServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Deprecated in favor of isVersioningEnabled property. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Deprecated in favor of isVersioningEnabled property.", + SerializedName = @"automaticSnapshotPolicyEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? AutomaticSnapshotPolicyEnabled { get; set; } + /// Indicates whether change feed event logging is enabled for the Blob service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether change feed event logging is enabled for the Blob service.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ChangeFeedEnabled { get; set; } + /// + /// Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). + /// A null value indicates an infinite retention of the change feed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). A null value indicates an infinite retention of the change feed.", + SerializedName = @"retentionInDays", + PossibleTypes = new [] { typeof(int) })] + int? ChangeFeedRetentionInDay { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.", + SerializedName = @"allowPermanentDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerDeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(int) })] + int? ContainerDeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether DeleteRetentionPolicy is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ContainerDeleteRetentionPolicyEnabled { get; set; } + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// + /// DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version + /// is not specified. Possible values include version 2008-10-27 and all more recent versions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version is not specified. Possible values include version 2008-10-27 and all more recent versions.", + SerializedName = @"defaultServiceVersion", + PossibleTypes = new [] { typeof(string) })] + string DefaultServiceVersion { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.", + SerializedName = @"allowPermanentDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? DeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(int) })] + int? DeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether DeleteRetentionPolicy is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? DeleteRetentionPolicyEnabled { get; set; } + /// Versioning is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Versioning is enabled if set to true.", + SerializedName = @"isVersioningEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsVersioningEnabled { get; set; } + /// + /// An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only", + SerializedName = @"blobType", + PossibleTypes = new [] { typeof(string) })] + string[] LastAccessTimeTrackingPolicyBlobType { get; set; } + /// When set to true last access time based tracking is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When set to true last access time based tracking is enabled.", + SerializedName = @"enable", + PossibleTypes = new [] { typeof(bool) })] + bool? LastAccessTimeTrackingPolicyEnable { get; set; } + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the policy. The valid value is AccessTimeTracking. This field is currently read only", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name? LastAccessTimeTrackingPolicyName { get; set; } + /// + /// The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This + /// field is currently read only with value as 1 + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This field is currently read only with value as 1", + SerializedName = @"trackingGranularityInDays", + PossibleTypes = new [] { typeof(int) })] + int? LastAccessTimeTrackingPolicyTrackingGranularityInDay { get; set; } + /// + /// how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(int) })] + int? RestorePolicyDay { get; set; } + /// Blob restore is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob restore is enabled if set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? RestorePolicyEnabled { get; set; } + /// Deprecated in favor of minRestoreTime property. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Deprecated in favor of minRestoreTime property.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RestorePolicyLastEnabledTime { get; } + /// Returns the minimum date and time that the restore can be started. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the minimum date and time that the restore can be started.", + SerializedName = @"minRestoreTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? RestorePolicyMinRestoreTime { get; } + + } + /// The properties of a storage account’s Blob service. + internal partial interface IBlobServicePropertiesAutoGeneratedInternal + + { + /// Deprecated in favor of isVersioningEnabled property. + bool? AutomaticSnapshotPolicyEnabled { get; set; } + /// The blob service properties for change feed events. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed ChangeFeed { get; set; } + /// Indicates whether change feed event logging is enabled for the Blob service. + bool? ChangeFeedEnabled { get; set; } + /// + /// Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). + /// A null value indicates an infinite retention of the change feed. + /// + int? ChangeFeedRetentionInDay { get; set; } + /// The blob service properties for container soft delete. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy ContainerDeleteRetentionPolicy { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + bool? ContainerDeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + int? ContainerDeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + bool? ContainerDeleteRetentionPolicyEnabled { get; set; } + /// + /// Specifies CORS rules for the Blob service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Blob service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get; set; } + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// + /// DefaultServiceVersion indicates the default version to use for requests to the Blob service if an incoming request’s version + /// is not specified. Possible values include version 2008-10-27 and all more recent versions. + /// + string DefaultServiceVersion { get; set; } + /// The blob service properties for blob soft delete. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy DeleteRetentionPolicy { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + bool? DeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + int? DeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + bool? DeleteRetentionPolicyEnabled { get; set; } + /// Versioning is enabled if set to true. + bool? IsVersioningEnabled { get; set; } + /// The blob service property to configure last access time based tracking policy. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy LastAccessTimeTrackingPolicy { get; set; } + /// + /// An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only + /// + string[] LastAccessTimeTrackingPolicyBlobType { get; set; } + /// When set to true last access time based tracking is enabled. + bool? LastAccessTimeTrackingPolicyEnable { get; set; } + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name? LastAccessTimeTrackingPolicyName { get; set; } + /// + /// The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This + /// field is currently read only with value as 1 + /// + int? LastAccessTimeTrackingPolicyTrackingGranularityInDay { get; set; } + /// The blob service properties for blob restore policy. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties RestorePolicy { get; set; } + /// + /// how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + /// + int? RestorePolicyDay { get; set; } + /// Blob restore is enabled if set to true. + bool? RestorePolicyEnabled { get; set; } + /// Deprecated in favor of minRestoreTime property. + global::System.DateTime? RestorePolicyLastEnabledTime { get; set; } + /// Returns the minimum date and time that the restore can be started. + global::System.DateTime? RestorePolicyMinRestoreTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..a57c62f761e0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/BlobServicePropertiesAutoGenerated.json.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Blob service. + public partial class BlobServicePropertiesAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal BlobServicePropertiesAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cor = If( json?.PropertyT("cors"), out var __jsonCors) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules.FromJson(__jsonCors) : Cor;} + {_deleteRetentionPolicy = If( json?.PropertyT("deleteRetentionPolicy"), out var __jsonDeleteRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy.FromJson(__jsonDeleteRetentionPolicy) : DeleteRetentionPolicy;} + {_changeFeed = If( json?.PropertyT("changeFeed"), out var __jsonChangeFeed) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ChangeFeed.FromJson(__jsonChangeFeed) : ChangeFeed;} + {_restorePolicy = If( json?.PropertyT("restorePolicy"), out var __jsonRestorePolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestorePolicyProperties.FromJson(__jsonRestorePolicy) : RestorePolicy;} + {_containerDeleteRetentionPolicy = If( json?.PropertyT("containerDeleteRetentionPolicy"), out var __jsonContainerDeleteRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy.FromJson(__jsonContainerDeleteRetentionPolicy) : ContainerDeleteRetentionPolicy;} + {_lastAccessTimeTrackingPolicy = If( json?.PropertyT("lastAccessTimeTrackingPolicy"), out var __jsonLastAccessTimeTrackingPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LastAccessTimeTrackingPolicy.FromJson(__jsonLastAccessTimeTrackingPolicy) : LastAccessTimeTrackingPolicy;} + {_defaultServiceVersion = If( json?.PropertyT("defaultServiceVersion"), out var __jsonDefaultServiceVersion) ? (string)__jsonDefaultServiceVersion : (string)DefaultServiceVersion;} + {_isVersioningEnabled = If( json?.PropertyT("isVersioningEnabled"), out var __jsonIsVersioningEnabled) ? (bool?)__jsonIsVersioningEnabled : IsVersioningEnabled;} + {_automaticSnapshotPolicyEnabled = If( json?.PropertyT("automaticSnapshotPolicyEnabled"), out var __jsonAutomaticSnapshotPolicyEnabled) ? (bool?)__jsonAutomaticSnapshotPolicyEnabled : AutomaticSnapshotPolicyEnabled;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServicePropertiesAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new BlobServicePropertiesAutoGenerated(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._cor ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._cor.ToJson(null,serializationMode) : null, "cors" ,container.Add ); + AddIf( null != this._deleteRetentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._deleteRetentionPolicy.ToJson(null,serializationMode) : null, "deleteRetentionPolicy" ,container.Add ); + AddIf( null != this._changeFeed ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._changeFeed.ToJson(null,serializationMode) : null, "changeFeed" ,container.Add ); + AddIf( null != this._restorePolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._restorePolicy.ToJson(null,serializationMode) : null, "restorePolicy" ,container.Add ); + AddIf( null != this._containerDeleteRetentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._containerDeleteRetentionPolicy.ToJson(null,serializationMode) : null, "containerDeleteRetentionPolicy" ,container.Add ); + AddIf( null != this._lastAccessTimeTrackingPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._lastAccessTimeTrackingPolicy.ToJson(null,serializationMode) : null, "lastAccessTimeTrackingPolicy" ,container.Add ); + AddIf( null != (((object)this._defaultServiceVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._defaultServiceVersion.ToString()) : null, "defaultServiceVersion" ,container.Add ); + AddIf( null != this._isVersioningEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isVersioningEnabled) : null, "isVersioningEnabled" ,container.Add ); + AddIf( null != this._automaticSnapshotPolicyEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._automaticSnapshotPolicyEnabled) : null, "automaticSnapshotPolicyEnabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.PowerShell.cs new file mode 100644 index 000000000000..3e39d682f73b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The blob service properties for change feed events. + [System.ComponentModel.TypeConverter(typeof(ChangeFeedTypeConverter))] + public partial class ChangeFeed + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ChangeFeed(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ChangeFeed(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RetentionInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).RetentionInDay = (int?) content.GetValueForProperty("RetentionInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal)this).RetentionInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ChangeFeed(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ChangeFeed(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The blob service properties for change feed events. + [System.ComponentModel.TypeConverter(typeof(ChangeFeedTypeConverter))] + public partial interface IChangeFeed + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.TypeConverter.cs new file mode 100644 index 000000000000..ea79fb1f257f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ChangeFeedTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ChangeFeed.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ChangeFeed.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ChangeFeed.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.cs b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.cs new file mode 100644 index 000000000000..6dd79d1373ac --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob service properties for change feed events. + public partial class ChangeFeed : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeedInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Indicates whether change feed event logging is enabled for the Blob service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private int? _retentionInDay; + + /// + /// Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). + /// A null value indicates an infinite retention of the change feed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? RetentionInDay { get => this._retentionInDay; set => this._retentionInDay = value; } + + /// Creates an new instance. + public ChangeFeed() + { + + } + } + /// The blob service properties for change feed events. + public partial interface IChangeFeed : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Indicates whether change feed event logging is enabled for the Blob service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether change feed event logging is enabled for the Blob service.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). + /// A null value indicates an infinite retention of the change feed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). A null value indicates an infinite retention of the change feed.", + SerializedName = @"retentionInDays", + PossibleTypes = new [] { typeof(int) })] + int? RetentionInDay { get; set; } + + } + /// The blob service properties for change feed events. + internal partial interface IChangeFeedInternal + + { + /// Indicates whether change feed event logging is enabled for the Blob service. + bool? Enabled { get; set; } + /// + /// Indicates the duration of changeFeed retention in days. Minimum value is 1 day and maximum value is 146000 days (400 years). + /// A null value indicates an infinite retention of the change feed. + /// + int? RetentionInDay { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.json.cs new file mode 100644 index 000000000000..8b257fc27e91 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ChangeFeed.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob service properties for change feed events. + public partial class ChangeFeed + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ChangeFeed(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_retentionInDay = If( json?.PropertyT("retentionInDays"), out var __jsonRetentionInDays) ? (int?)__jsonRetentionInDays : RetentionInDay;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IChangeFeed FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ChangeFeed(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != this._retentionInDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._retentionInDay) : null, "retentionInDays" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.PowerShell.cs new file mode 100644 index 000000000000..0557e3253a67 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The CheckNameAvailability operation response. + [System.ComponentModel.TypeConverter(typeof(CheckNameAvailabilityResultTypeConverter))] + public partial class CheckNameAvailabilityResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CheckNameAvailabilityResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NameAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CheckNameAvailabilityResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("NameAvailable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).NameAvailable = (bool?) content.GetValueForProperty("NameAvailable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).NameAvailable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Reason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Reason = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason?) content.GetValueForProperty("Reason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Reason, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason.CreateFrom); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CheckNameAvailabilityResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CheckNameAvailabilityResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The CheckNameAvailability operation response. + [System.ComponentModel.TypeConverter(typeof(CheckNameAvailabilityResultTypeConverter))] + public partial interface ICheckNameAvailabilityResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.TypeConverter.cs new file mode 100644 index 000000000000..f1cae3bbd6f2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CheckNameAvailabilityResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CheckNameAvailabilityResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CheckNameAvailabilityResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CheckNameAvailabilityResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.cs new file mode 100644 index 000000000000..2ba375ced60f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The CheckNameAvailability operation response. + public partial class CheckNameAvailabilityResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal + { + + /// Backing field for property. + private string _message; + + /// Gets an error message explaining the Reason value in more detail. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Message { get => this._message; } + + /// Internal Acessors for Message + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal.Message { get => this._message; set { {_message = value;} } } + + /// Internal Acessors for NameAvailable + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal.NameAvailable { get => this._nameAvailable; set { {_nameAvailable = value;} } } + + /// Internal Acessors for Reason + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResultInternal.Reason { get => this._reason; set { {_reason = value;} } } + + /// Backing field for property. + private bool? _nameAvailable; + + /// + /// Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, + /// the name has already been taken or is invalid and cannot be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? NameAvailable { get => this._nameAvailable; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason? _reason; + + /// + /// Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is + /// false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason? Reason { get => this._reason; } + + /// Creates an new instance. + public CheckNameAvailabilityResult() + { + + } + } + /// The CheckNameAvailability operation response. + public partial interface ICheckNameAvailabilityResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets an error message explaining the Reason value in more detail. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets an error message explaining the Reason value in more detail.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; } + /// + /// Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, + /// the name has already been taken or is invalid and cannot be used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, the name has already been taken or is invalid and cannot be used.", + SerializedName = @"nameAvailable", + PossibleTypes = new [] { typeof(bool) })] + bool? NameAvailable { get; } + /// + /// Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is + /// false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is false.", + SerializedName = @"reason", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason? Reason { get; } + + } + /// The CheckNameAvailability operation response. + internal partial interface ICheckNameAvailabilityResultInternal + + { + /// Gets an error message explaining the Reason value in more detail. + string Message { get; set; } + /// + /// Gets a boolean value that indicates whether the name is available for you to use. If true, the name is available. If false, + /// the name has already been taken or is invalid and cannot be used. + /// + bool? NameAvailable { get; set; } + /// + /// Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is + /// false. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason? Reason { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.json.cs new file mode 100644 index 000000000000..57358f25d8ca --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CheckNameAvailabilityResult.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The CheckNameAvailability operation response. + public partial class CheckNameAvailabilityResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal CheckNameAvailabilityResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_nameAvailable = If( json?.PropertyT("nameAvailable"), out var __jsonNameAvailable) ? (bool?)__jsonNameAvailable : NameAvailable;} + {_reason = If( json?.PropertyT("reason"), out var __jsonReason) ? (string)__jsonReason : (string)Reason;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new CheckNameAvailabilityResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._nameAvailable ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._nameAvailable) : null, "nameAvailable" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._reason)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._reason.ToString()) : null, "reason" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudError.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.PowerShell.cs new file mode 100644 index 000000000000..017e4923c802 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// An error response from the Storage service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] + public partial class CloudError + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CloudError(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudError(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudError(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudError(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the Storage service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorTypeConverter))] + public partial interface ICloudError + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudError.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.TypeConverter.cs new file mode 100644 index 000000000000..c918565bcdd5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudErrorTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudError.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudError.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudError.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudError.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.cs new file mode 100644 index 000000000000..b5addc7cbf61 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An error response from the Storage service. + public partial class CloudError : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal + { + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Code = value ?? null; } + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[] Detail { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Detail; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Detail = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody _error; + + /// An error response from the Storage service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBody()); set => this._error = value; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBody()); set { {_error = value;} } } + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Target { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Target; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)Error).Target = value ?? null; } + + /// Creates an new instance. + public CloudError() + { + + } + } + /// An error response from the Storage service. + public partial interface ICloudError : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// An error response from the Storage service. + internal partial interface ICloudErrorInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[] Detail { get; set; } + /// An error response from the Storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody Error { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudError.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.json.cs new file mode 100644 index 000000000000..15b8ae9ad985 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudError.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An error response from the Storage service. + public partial class CloudError + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal CloudError(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new CloudError(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.PowerShell.cs new file mode 100644 index 000000000000..788a319607cd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// An error response from the Storage service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] + public partial class CloudErrorBody + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CloudErrorBody(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CloudErrorBody(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Message, global::System.Convert.ToString); + } + if (content.Contains("Target")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Target = (string) content.GetValueForProperty("Target",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Target, global::System.Convert.ToString); + } + if (content.Contains("Detail")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Detail = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[]) content.GetValueForProperty("Detail",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal)this).Detail, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBodyTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CloudErrorBody(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CloudErrorBody(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the Storage service. + [System.ComponentModel.TypeConverter(typeof(CloudErrorBodyTypeConverter))] + public partial interface ICloudErrorBody + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.TypeConverter.cs new file mode 100644 index 000000000000..1c11cb4d9594 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CloudErrorBodyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CloudErrorBody.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CloudErrorBody.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CloudErrorBody.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.cs new file mode 100644 index 000000000000..d56611c7674a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An error response from the Storage service. + public partial class CloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBodyInternal + { + + /// Backing field for property. + private string _code; + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[] _detail; + + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[] Detail { get => this._detail; set => this._detail = value; } + + /// Backing field for property. + private string _message; + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Backing field for property. + private string _target; + + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Target { get => this._target; set => this._target = value; } + + /// Creates an new instance. + public CloudErrorBody() + { + + } + } + /// An error response from the Storage service. + public partial interface ICloudErrorBody : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// A list of additional details about the error. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A list of additional details about the error.", + SerializedName = @"details", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The target of the particular error. For example, the name of the property in error.", + SerializedName = @"target", + PossibleTypes = new [] { typeof(string) })] + string Target { get; set; } + + } + /// An error response from the Storage service. + internal partial interface ICloudErrorBodyInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// A list of additional details about the error. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody[] Detail { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + /// + /// The target of the particular error. For example, the name of the property in error. + /// + string Target { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.json.cs new file mode 100644 index 000000000000..01f257b844e3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CloudErrorBody.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An error response from the Storage service. + public partial class CloudErrorBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal CloudErrorBody(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + {_target = If( json?.PropertyT("target"), out var __jsonTarget) ? (string)__jsonTarget : (string)Target;} + {_detail = If( json?.PropertyT("details"), out var __jsonDetails) ? If( __jsonDetails as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudErrorBody.FromJson(__u) )) ))() : null : Detail;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudErrorBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new CloudErrorBody(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AddIf( null != (((object)this._target)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._target.ToString()) : null, "target" ,container.Add ); + if (null != this._detail) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._detail ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("details",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.PowerShell.cs new file mode 100644 index 000000000000..de170a8d2475 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.PowerShell.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a container. + [System.ComponentModel.TypeConverter(typeof(ContainerPropertiesTypeConverter))] + public partial class ContainerProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a container. + [System.ComponentModel.TypeConverter(typeof(ContainerPropertiesTypeConverter))] + public partial interface IContainerProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.TypeConverter.cs new file mode 100644 index 000000000000..bd77ce0c4e31 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.cs new file mode 100644 index 000000000000..e365f8ea1bff --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.cs @@ -0,0 +1,696 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a container. + public partial class ContainerProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal + { + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWritesAll { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWritesAll = value ?? default(bool); } + + /// Backing field for property. + private string _defaultEncryptionScope; + + /// Default the container to use specified encryption scope for all writes. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DefaultEncryptionScope { get => this._defaultEncryptionScope; set => this._defaultEncryptionScope = value; } + + /// Backing field for property. + private bool? _deleted; + + /// Indicates whether the blob container was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Deleted { get => this._deleted; } + + /// Backing field for property. + private global::System.DateTime? _deletedTime; + + /// Blob container deletion time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? DeletedTime { get => this._deletedTime; } + + /// Backing field for property. + private bool? _denyEncryptionScopeOverride; + + /// Block override of encryption scope from the container default. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? DenyEncryptionScopeOverride { get => this._denyEncryptionScopeOverride; set => this._denyEncryptionScopeOverride = value; } + + /// Backing field for property. + private bool? _enableNfsV3AllSquash; + + /// Enable NFSv3 all squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableNfsV3AllSquash { get => this._enableNfsV3AllSquash; set => this._enableNfsV3AllSquash = value; } + + /// Backing field for property. + private bool? _enableNfsV3RootSquash; + + /// Enable NFSv3 root squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableNfsV3RootSquash { get => this._enableNfsV3RootSquash; set => this._enableNfsV3RootSquash = value; } + + /// Backing field for property. + private bool? _hasImmutabilityPolicy; + + /// + /// The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. + /// The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? HasImmutabilityPolicy { get => this._hasImmutabilityPolicy; } + + /// Backing field for property. + private bool? _hasLegalHold; + + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? HasLegalHold { get => this._hasLegalHold; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).ImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties _immutabilityPolicy; + + /// The ImmutabilityPolicy property of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperties()); } + + /// ImmutabilityPolicy Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ImmutabilityPolicyEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Etag; } + + /// The ImmutabilityPolicy update history of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).UpdateHistory; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning _immutableStorageWithVersioning; + + /// + /// The object level immutability property of the container. The property is immutable and can only be set to true at the + /// container creation time. Existing containers must undergo a migration process. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioning()); set => this._immutableStorageWithVersioning = value; } + + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).Enabled = value ?? default(bool); } + + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? ImmutableStorageWithVersioningMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).MigrationState; } + + /// Returns the date and time the object level immutability was enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ImmutableStorageWithVersioningTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).TimeStamp; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Returns the date and time the container was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? _leaseDuration; + + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get => this._leaseDuration; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? _leaseState; + + /// Lease state of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get => this._leaseState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? _leaseStatus; + + /// The lease status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get => this._leaseStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties _legalHold; + + /// The LegalHold property of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties LegalHold { get => (this._legalHold = this._legalHold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldProperties()); } + + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? LegalHoldHasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).HasLegalHold; } + + /// The list of LegalHold tags of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] LegalHoldTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).Tag = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata _metadata; + + /// A name-value pair to associate with the container as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadata()); set => this._metadata = value; } + + /// Internal Acessors for Deleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.Deleted { get => this._deleted; set { {_deleted = value;} } } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.DeletedTime { get => this._deletedTime; set { {_deletedTime = value;} } } + + /// Internal Acessors for HasImmutabilityPolicy + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.HasImmutabilityPolicy { get => this._hasImmutabilityPolicy; set { {_hasImmutabilityPolicy = value;} } } + + /// Internal Acessors for HasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.HasLegalHold { get => this._hasLegalHold; set { {_hasLegalHold = value;} } } + + /// Internal Acessors for ImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperties()); set { {_immutabilityPolicy = value;} } } + + /// Internal Acessors for ImmutabilityPolicyEtag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ImmutabilityPolicyEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Etag = value; } + + /// Internal Acessors for ImmutabilityPolicyProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ImmutabilityPolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Property; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).Property = value; } + + /// Internal Acessors for ImmutabilityPolicyUpdateHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).UpdateHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).UpdateHistory = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioning()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningMigrationState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ImmutableStorageWithVersioningMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).MigrationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).MigrationState = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningTimeStamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ImmutableStorageWithVersioningTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).TimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)ImmutableStorageWithVersioning).TimeStamp = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for LeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.LeaseDuration { get => this._leaseDuration; set { {_leaseDuration = value;} } } + + /// Internal Acessors for LeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.LeaseState { get => this._leaseState; set { {_leaseState = value;} } } + + /// Internal Acessors for LeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.LeaseStatus { get => this._leaseStatus; set { {_leaseStatus = value;} } } + + /// Internal Acessors for LegalHold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.LegalHold { get => (this._legalHold = this._legalHold ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldProperties()); set { {_legalHold = value;} } } + + /// Internal Acessors for LegalHoldHasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.LegalHoldHasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).HasLegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).HasLegalHold = value; } + + /// Internal Acessors for LegalHoldProtectedAppendWritesHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.LegalHoldProtectedAppendWritesHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWritesHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWritesHistory = value; } + + /// Internal Acessors for ProtectedAppendWriteHistoryTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryTimestamp = value; } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.RemainingRetentionDay { get => this._remainingRetentionDay; set { {_remainingRetentionDay = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal.Version { get => this._version; set { {_version = value;} } } + + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = value ?? default(bool); } + + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)LegalHold).ProtectedAppendWriteHistoryTimestamp; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess? _publicAccess; + + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess? PublicAccess { get => this._publicAccess; set => this._publicAccess = value; } + + /// Backing field for property. + private int? _remainingRetentionDay; + + /// Remaining retention days for soft deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? RemainingRetentionDay { get => this._remainingRetentionDay; } + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State; } + + /// Backing field for property. + private string _version; + + /// The version of the deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public ContainerProperties() + { + + } + } + /// The properties of a container. + public partial interface IContainerProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + /// Default the container to use specified encryption scope for all writes. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default the container to use specified encryption scope for all writes.", + SerializedName = @"defaultEncryptionScope", + PossibleTypes = new [] { typeof(string) })] + string DefaultEncryptionScope { get; set; } + /// Indicates whether the blob container was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates whether the blob container was deleted.", + SerializedName = @"deleted", + PossibleTypes = new [] { typeof(bool) })] + bool? Deleted { get; } + /// Blob container deletion time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Blob container deletion time.", + SerializedName = @"deletedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeletedTime { get; } + /// Block override of encryption scope from the container default. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Block override of encryption scope from the container default.", + SerializedName = @"denyEncryptionScopeOverride", + PossibleTypes = new [] { typeof(bool) })] + bool? DenyEncryptionScopeOverride { get; set; } + /// Enable NFSv3 all squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable NFSv3 all squash on blob container.", + SerializedName = @"enableNfsV3AllSquash", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3AllSquash { get; set; } + /// Enable NFSv3 root squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable NFSv3 root squash on blob container.", + SerializedName = @"enableNfsV3RootSquash", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3RootSquash { get; set; } + /// + /// The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. + /// The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container.", + SerializedName = @"hasImmutabilityPolicy", + PossibleTypes = new [] { typeof(bool) })] + bool? HasImmutabilityPolicy { get; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.", + SerializedName = @"hasLegalHold", + PossibleTypes = new [] { typeof(bool) })] + bool? HasLegalHold { get; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// ImmutabilityPolicy Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ImmutabilityPolicy Etag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string ImmutabilityPolicyEtag { get; } + /// The ImmutabilityPolicy update history of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy update history of the blob container.", + SerializedName = @"updateHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get; } + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is an immutable property, when set to true it enables object level immutability at the container level.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property denotes the container level immutability to object level immutability migration state.", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? ImmutableStorageWithVersioningMigrationState { get; } + /// Returns the date and time the object level immutability was enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the object level immutability was enabled.", + SerializedName = @"timeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ImmutableStorageWithVersioningTimeStamp { get; } + /// Returns the date and time the container was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the container was last modified.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; } + /// Lease state of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Lease state of the container.", + SerializedName = @"leaseState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; } + /// The lease status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The lease status of the container.", + SerializedName = @"leaseStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.", + SerializedName = @"hasLegalHold", + PossibleTypes = new [] { typeof(bool) })] + bool? LegalHoldHasLegalHold { get; } + /// The list of LegalHold tags of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of LegalHold tags of a blob container.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] LegalHoldTag { get; set; } + /// A name-value pair to associate with the container as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the container as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata Metadata { get; set; } + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the tag was added.", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get; } + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether data in the container may be accessed publicly and the level of access.", + SerializedName = @"publicAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess? PublicAccess { get; set; } + /// Remaining retention days for soft deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Remaining retention days for soft deleted blob container.", + SerializedName = @"remainingRetentionDays", + PossibleTypes = new [] { typeof(int) })] + int? RemainingRetentionDay { get; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; } + /// The version of the deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of the deleted blob container.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// The properties of a container. + internal partial interface IContainerPropertiesInternal + + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + /// Default the container to use specified encryption scope for all writes. + string DefaultEncryptionScope { get; set; } + /// Indicates whether the blob container was deleted. + bool? Deleted { get; set; } + /// Blob container deletion time. + global::System.DateTime? DeletedTime { get; set; } + /// Block override of encryption scope from the container default. + bool? DenyEncryptionScopeOverride { get; set; } + /// Enable NFSv3 all squash on blob container. + bool? EnableNfsV3AllSquash { get; set; } + /// Enable NFSv3 root squash on blob container. + bool? EnableNfsV3RootSquash { get; set; } + /// + /// The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. + /// The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + /// + bool? HasImmutabilityPolicy { get; set; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + bool? HasLegalHold { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// The ImmutabilityPolicy property of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties ImmutabilityPolicy { get; set; } + /// ImmutabilityPolicy Etag. + string ImmutabilityPolicyEtag { get; set; } + /// The properties of an ImmutabilityPolicy of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty ImmutabilityPolicyProperty { get; set; } + /// The ImmutabilityPolicy update history of the blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get; set; } + /// + /// The object level immutability property of the container. The property is immutable and can only be set to true at the + /// container creation time. Existing containers must undergo a migration process. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning ImmutableStorageWithVersioning { get; set; } + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? ImmutableStorageWithVersioningMigrationState { get; set; } + /// Returns the date and time the object level immutability was enabled. + global::System.DateTime? ImmutableStorageWithVersioningTimeStamp { get; set; } + /// Returns the date and time the container was last modified. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; set; } + /// Lease state of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; set; } + /// The lease status of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; set; } + /// The LegalHold property of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties LegalHold { get; set; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + bool? LegalHoldHasLegalHold { get; set; } + /// Protected append blob writes history. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory LegalHoldProtectedAppendWritesHistory { get; set; } + /// The list of LegalHold tags of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] LegalHoldTag { get; set; } + /// A name-value pair to associate with the container as metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata Metadata { get; set; } + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get; set; } + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess? PublicAccess { get; set; } + /// Remaining retention days for soft deleted blob container. + int? RemainingRetentionDay { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; set; } + /// The version of the deleted blob container. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.json.cs new file mode 100644 index 000000000000..6a4aea6f1f56 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerProperties.json.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a container. + public partial class ContainerProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ContainerProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_immutabilityPolicy = If( json?.PropertyT("immutabilityPolicy"), out var __jsonImmutabilityPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperties.FromJson(__jsonImmutabilityPolicy) : ImmutabilityPolicy;} + {_legalHold = If( json?.PropertyT("legalHold"), out var __jsonLegalHold) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldProperties.FromJson(__jsonLegalHold) : LegalHold;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioning.FromJson(__jsonImmutableStorageWithVersioning) : ImmutableStorageWithVersioning;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_deleted = If( json?.PropertyT("deleted"), out var __jsonDeleted) ? (bool?)__jsonDeleted : Deleted;} + {_deletedTime = If( json?.PropertyT("deletedTime"), out var __jsonDeletedTime) ? global::System.DateTime.TryParse((string)__jsonDeletedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeletedTimeValue) ? __jsonDeletedTimeValue : DeletedTime : DeletedTime;} + {_remainingRetentionDay = If( json?.PropertyT("remainingRetentionDays"), out var __jsonRemainingRetentionDays) ? (int?)__jsonRemainingRetentionDays : RemainingRetentionDay;} + {_defaultEncryptionScope = If( json?.PropertyT("defaultEncryptionScope"), out var __jsonDefaultEncryptionScope) ? (string)__jsonDefaultEncryptionScope : (string)DefaultEncryptionScope;} + {_denyEncryptionScopeOverride = If( json?.PropertyT("denyEncryptionScopeOverride"), out var __jsonDenyEncryptionScopeOverride) ? (bool?)__jsonDenyEncryptionScopeOverride : DenyEncryptionScopeOverride;} + {_publicAccess = If( json?.PropertyT("publicAccess"), out var __jsonPublicAccess) ? (string)__jsonPublicAccess : (string)PublicAccess;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + {_leaseStatus = If( json?.PropertyT("leaseStatus"), out var __jsonLeaseStatus) ? (string)__jsonLeaseStatus : (string)LeaseStatus;} + {_leaseState = If( json?.PropertyT("leaseState"), out var __jsonLeaseState) ? (string)__jsonLeaseState : (string)LeaseState;} + {_leaseDuration = If( json?.PropertyT("leaseDuration"), out var __jsonLeaseDuration) ? (string)__jsonLeaseDuration : (string)LeaseDuration;} + {_metadata = If( json?.PropertyT("metadata"), out var __jsonMetadata) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadata.FromJson(__jsonMetadata) : Metadata;} + {_hasLegalHold = If( json?.PropertyT("hasLegalHold"), out var __jsonHasLegalHold) ? (bool?)__jsonHasLegalHold : HasLegalHold;} + {_hasImmutabilityPolicy = If( json?.PropertyT("hasImmutabilityPolicy"), out var __jsonHasImmutabilityPolicy) ? (bool?)__jsonHasImmutabilityPolicy : HasImmutabilityPolicy;} + {_enableNfsV3RootSquash = If( json?.PropertyT("enableNfsV3RootSquash"), out var __jsonEnableNfsV3RootSquash) ? (bool?)__jsonEnableNfsV3RootSquash : EnableNfsV3RootSquash;} + {_enableNfsV3AllSquash = If( json?.PropertyT("enableNfsV3AllSquash"), out var __jsonEnableNfsV3AllSquash) ? (bool?)__jsonEnableNfsV3AllSquash : EnableNfsV3AllSquash;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ContainerProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._immutabilityPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._immutabilityPolicy.ToJson(null,serializationMode) : null, "immutabilityPolicy" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._legalHold ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._legalHold.ToJson(null,serializationMode) : null, "legalHold" ,container.Add ); + } + AddIf( null != this._immutableStorageWithVersioning ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._immutableStorageWithVersioning.ToJson(null,serializationMode) : null, "immutableStorageWithVersioning" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._deleted ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._deleted) : null, "deleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._deletedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._deletedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "deletedTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._remainingRetentionDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._remainingRetentionDay) : null, "remainingRetentionDays" ,container.Add ); + } + AddIf( null != (((object)this._defaultEncryptionScope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._defaultEncryptionScope.ToString()) : null, "defaultEncryptionScope" ,container.Add ); + AddIf( null != this._denyEncryptionScopeOverride ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._denyEncryptionScopeOverride) : null, "denyEncryptionScopeOverride" ,container.Add ); + AddIf( null != (((object)this._publicAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._publicAccess.ToString()) : null, "publicAccess" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._leaseStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseStatus.ToString()) : null, "leaseStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._leaseState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseState.ToString()) : null, "leaseState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._leaseDuration)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseDuration.ToString()) : null, "leaseDuration" ,container.Add ); + } + AddIf( null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._metadata.ToJson(null,serializationMode) : null, "metadata" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._hasLegalHold ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._hasLegalHold) : null, "hasLegalHold" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._hasImmutabilityPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._hasImmutabilityPolicy) : null, "hasImmutabilityPolicy" ,container.Add ); + } + AddIf( null != this._enableNfsV3RootSquash ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableNfsV3RootSquash) : null, "enableNfsV3RootSquash" ,container.Add ); + AddIf( null != this._enableNfsV3AllSquash ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableNfsV3AllSquash) : null, "enableNfsV3AllSquash" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..7d51608bcfc4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A name-value pair to associate with the container as metadata. + [System.ComponentModel.TypeConverter(typeof(ContainerPropertiesMetadataTypeConverter))] + public partial class ContainerPropertiesMetadata + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ContainerPropertiesMetadata(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ContainerPropertiesMetadata(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ContainerPropertiesMetadata(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ContainerPropertiesMetadata(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A name-value pair to associate with the container as metadata. + [System.ComponentModel.TypeConverter(typeof(ContainerPropertiesMetadataTypeConverter))] + public partial interface IContainerPropertiesMetadata + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..cf584576b507 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ContainerPropertiesMetadataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ContainerPropertiesMetadata.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ContainerPropertiesMetadata.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ContainerPropertiesMetadata.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.cs new file mode 100644 index 000000000000..ce6765aab805 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair to associate with the container as metadata. + public partial class ContainerPropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadataInternal + { + + /// Creates an new instance. + public ContainerPropertiesMetadata() + { + + } + } + /// A name-value pair to associate with the container as metadata. + public partial interface IContainerPropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// A name-value pair to associate with the container as metadata. + internal partial interface IContainerPropertiesMetadataInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.dictionary.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..4b6511e2072f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ContainerPropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.json.cs new file mode 100644 index 000000000000..3a5a163f2f45 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ContainerPropertiesMetadata.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair to associate with the container as metadata. + public partial class ContainerPropertiesMetadata + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ContainerPropertiesMetadata(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ContainerPropertiesMetadata(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.PowerShell.cs new file mode 100644 index 000000000000..50eb8c065032 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Specifies a CORS rule for the Blob service. + [System.ComponentModel.TypeConverter(typeof(CorsRuleTypeConverter))] + public partial class CorsRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CorsRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AllowedOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedOrigin = (string[]) content.GetValueForProperty("AllowedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedMethod = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[]) content.GetValueForProperty("AllowedMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedMethod, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods.CreateFrom)); + } + if (content.Contains("MaxAgeInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).MaxAgeInSecond = (int) content.GetValueForProperty("MaxAgeInSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).MaxAgeInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExposedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).ExposedHeader = (string[]) content.GetValueForProperty("ExposedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).ExposedHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedHeader = (string[]) content.GetValueForProperty("AllowedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CorsRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AllowedOrigin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedOrigin = (string[]) content.GetValueForProperty("AllowedOrigin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedOrigin, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedMethod = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[]) content.GetValueForProperty("AllowedMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedMethod, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods.CreateFrom)); + } + if (content.Contains("MaxAgeInSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).MaxAgeInSecond = (int) content.GetValueForProperty("MaxAgeInSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).MaxAgeInSecond, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ExposedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).ExposedHeader = (string[]) content.GetValueForProperty("ExposedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).ExposedHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowedHeader")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedHeader = (string[]) content.GetValueForProperty("AllowedHeader",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal)this).AllowedHeader, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CorsRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CorsRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Specifies a CORS rule for the Blob service. + [System.ComponentModel.TypeConverter(typeof(CorsRuleTypeConverter))] + public partial interface ICorsRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.TypeConverter.cs new file mode 100644 index 000000000000..f9b31cfd049d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CorsRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CorsRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CorsRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CorsRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.cs new file mode 100644 index 000000000000..b38466cd2931 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Specifies a CORS rule for the Blob service. + public partial class CorsRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRuleInternal + { + + /// Backing field for property. + private string[] _allowedHeader; + + /// + /// Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] AllowedHeader { get => this._allowedHeader; set => this._allowedHeader = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[] _allowedMethod; + + /// + /// Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[] AllowedMethod { get => this._allowedMethod; set => this._allowedMethod = value; } + + /// Backing field for property. + private string[] _allowedOrigin; + + /// + /// Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] AllowedOrigin { get => this._allowedOrigin; set => this._allowedOrigin = value; } + + /// Backing field for property. + private string[] _exposedHeader; + + /// + /// Required if CorsRule element is present. A list of response headers to expose to CORS clients. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] ExposedHeader { get => this._exposedHeader; set => this._exposedHeader = value; } + + /// Backing field for property. + private int _maxAgeInSecond; + + /// + /// Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int MaxAgeInSecond { get => this._maxAgeInSecond; set => this._maxAgeInSecond = value; } + + /// Creates an new instance. + public CorsRule() + { + + } + } + /// Specifies a CORS rule for the Blob service. + public partial interface ICorsRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request.", + SerializedName = @"allowedHeaders", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedHeader { get; set; } + /// + /// Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin.", + SerializedName = @"allowedMethods", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[] AllowedMethod { get; set; } + /// + /// Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or ""*"" to allow all domains", + SerializedName = @"allowedOrigins", + PossibleTypes = new [] { typeof(string) })] + string[] AllowedOrigin { get; set; } + /// + /// Required if CorsRule element is present. A list of response headers to expose to CORS clients. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required if CorsRule element is present. A list of response headers to expose to CORS clients.", + SerializedName = @"exposedHeaders", + PossibleTypes = new [] { typeof(string) })] + string[] ExposedHeader { get; set; } + /// + /// Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response.", + SerializedName = @"maxAgeInSeconds", + PossibleTypes = new [] { typeof(int) })] + int MaxAgeInSecond { get; set; } + + } + /// Specifies a CORS rule for the Blob service. + internal partial interface ICorsRuleInternal + + { + /// + /// Required if CorsRule element is present. A list of headers allowed to be part of the cross-origin request. + /// + string[] AllowedHeader { get; set; } + /// + /// Required if CorsRule element is present. A list of HTTP methods that are allowed to be executed by the origin. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods[] AllowedMethod { get; set; } + /// + /// Required if CorsRule element is present. A list of origin domains that will be allowed via CORS, or "*" to allow all domains + /// + string[] AllowedOrigin { get; set; } + /// + /// Required if CorsRule element is present. A list of response headers to expose to CORS clients. + /// + string[] ExposedHeader { get; set; } + /// + /// Required if CorsRule element is present. The number of seconds that the client/browser should cache a preflight response. + /// + int MaxAgeInSecond { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.json.cs new file mode 100644 index 000000000000..20a58ab6b60a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRule.json.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Specifies a CORS rule for the Blob service. + public partial class CorsRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal CorsRule(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_allowedOrigin = If( json?.PropertyT("allowedOrigins"), out var __jsonAllowedOrigins) ? If( __jsonAllowedOrigins as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : AllowedOrigin;} + {_allowedMethod = If( json?.PropertyT("allowedMethods"), out var __jsonAllowedMethods) ? If( __jsonAllowedMethods as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods) (__p is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __o ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods)(__o.ToString()) : ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods)""))) ))() : null : AllowedMethod;} + {_maxAgeInSecond = If( json?.PropertyT("maxAgeInSeconds"), out var __jsonMaxAgeInSeconds) ? (int)__jsonMaxAgeInSeconds : MaxAgeInSecond;} + {_exposedHeader = If( json?.PropertyT("exposedHeaders"), out var __jsonExposedHeaders) ? If( __jsonExposedHeaders as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(string) (__k is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __j ? (string)(__j.ToString()) : null)) ))() : null : ExposedHeader;} + {_allowedHeader = If( json?.PropertyT("allowedHeaders"), out var __jsonAllowedHeaders) ? If( __jsonAllowedHeaders as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __g) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__g, (__f)=>(string) (__f is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __e ? (string)(__e.ToString()) : null)) ))() : null : AllowedHeader;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new CorsRule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._allowedOrigin) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._allowedOrigin ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("allowedOrigins",__w); + } + if (null != this._allowedMethod) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._allowedMethod ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("allowedMethods",__r); + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber(this._maxAgeInSecond), "maxAgeInSeconds" ,container.Add ); + if (null != this._exposedHeader) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __n in this._exposedHeader ) + { + AddIf(null != (((object)__n)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__n.ToString()) : null ,__m.Add); + } + container.Add("exposedHeaders",__m); + } + if (null != this._allowedHeader) + { + var __h = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __i in this._allowedHeader ) + { + AddIf(null != (((object)__i)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__i.ToString()) : null ,__h.Add); + } + container.Add("allowedHeaders",__h); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.PowerShell.cs new file mode 100644 index 000000000000..72a80b590fc7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Sets the CORS rules. You can include up to five CorsRule elements in the request. + /// + [System.ComponentModel.TypeConverter(typeof(CorsRulesTypeConverter))] + public partial class CorsRules + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CorsRules(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)this).CorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)this).CorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CorsRules(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)this).CorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)this).CorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CorsRules(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CorsRules(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Sets the CORS rules. You can include up to five CorsRule elements in the request. + [System.ComponentModel.TypeConverter(typeof(CorsRulesTypeConverter))] + public partial interface ICorsRules + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.TypeConverter.cs new file mode 100644 index 000000000000..3c95f1ab758c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CorsRulesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CorsRules.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CorsRules.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CorsRules.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.cs new file mode 100644 index 000000000000..69ee7e369c86 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Sets the CORS rules. You can include up to five CorsRule elements in the request. + /// + public partial class CorsRules : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] _corsRule; + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorsRule { get => this._corsRule; set => this._corsRule = value; } + + /// Creates an new instance. + public CorsRules() + { + + } + } + /// Sets the CORS rules. You can include up to five CorsRule elements in the request. + public partial interface ICorsRules : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorsRule { get; set; } + + } + /// Sets the CORS rules. You can include up to five CorsRule elements in the request. + internal partial interface ICorsRulesInternal + + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorsRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.json.cs new file mode 100644 index 000000000000..476b2a4ff964 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CorsRules.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Sets the CORS rules. You can include up to five CorsRule elements in the request. + /// + public partial class CorsRules + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal CorsRules(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_corsRule = If( json?.PropertyT("corsRules"), out var __jsonCorsRules) ? If( __jsonCorsRules as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRule.FromJson(__u) )) ))() : null : CorsRule;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new CorsRules(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._corsRule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._corsRule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("corsRules",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.PowerShell.cs new file mode 100644 index 000000000000..d2f270fde369 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The custom domain assigned to this storage account. This can be set via Update. + [System.ComponentModel.TypeConverter(typeof(CustomDomainTypeConverter))] + public partial class CustomDomain + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal CustomDomain(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("UseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).UseSubDomainName = (bool?) content.GetValueForProperty("UseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).UseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal CustomDomain(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("UseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).UseSubDomainName = (bool?) content.GetValueForProperty("UseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)this).UseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new CustomDomain(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new CustomDomain(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The custom domain assigned to this storage account. This can be set via Update. + [System.ComponentModel.TypeConverter(typeof(CustomDomainTypeConverter))] + public partial interface ICustomDomain + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.TypeConverter.cs new file mode 100644 index 000000000000..6437ee1970da --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class CustomDomainTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return CustomDomain.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return CustomDomain.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return CustomDomain.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.cs b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.cs new file mode 100644 index 000000000000..8a281382b876 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The custom domain assigned to this storage account. This can be set via Update. + public partial class CustomDomain : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal + { + + /// Backing field for property. + private string _name; + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private bool? _useSubDomainName; + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? UseSubDomainName { get => this._useSubDomainName; set => this._useSubDomainName = value; } + + /// Creates an new instance. + public CustomDomain() + { + + } + } + /// The custom domain assigned to this storage account. This can be set via Update. + public partial interface ICustomDomain : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(bool) })] + bool? UseSubDomainName { get; set; } + + } + /// The custom domain assigned to this storage account. This can be set via Update. + internal partial interface ICustomDomainInternal + + { + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + string Name { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + bool? UseSubDomainName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.json.cs new file mode 100644 index 000000000000..50920433a95c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/CustomDomain.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The custom domain assigned to this storage account. This can be set via Update. + public partial class CustomDomain + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal CustomDomain(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_useSubDomainName = If( json?.PropertyT("useSubDomainName"), out var __jsonUseSubDomainName) ? (bool?)__jsonUseSubDomainName : UseSubDomainName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new CustomDomain(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != this._useSubDomainName ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._useSubDomainName) : null, "useSubDomainName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.PowerShell.cs new file mode 100644 index 000000000000..4688fd76a948 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Object to define snapshot and version action conditions. + [System.ComponentModel.TypeConverter(typeof(DateAfterCreationTypeConverter))] + public partial class DateAfterCreation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DateAfterCreation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DateAfterCreation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)this).DaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DateAfterCreation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DateAfterCreation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Object to define snapshot and version action conditions. + [System.ComponentModel.TypeConverter(typeof(DateAfterCreationTypeConverter))] + public partial interface IDateAfterCreation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.TypeConverter.cs new file mode 100644 index 000000000000..5fa80796f511 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DateAfterCreationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DateAfterCreation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DateAfterCreation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DateAfterCreation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.cs new file mode 100644 index 000000000000..54a463e5584b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Object to define snapshot and version action conditions. + public partial class DateAfterCreation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal + { + + /// Backing field for property. + private float _daysAfterCreationGreaterThan; + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float DaysAfterCreationGreaterThan { get => this._daysAfterCreationGreaterThan; set => this._daysAfterCreationGreaterThan = value; } + + /// Backing field for property. + private float? _daysAfterLastTierChangeGreaterThan; + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float? DaysAfterLastTierChangeGreaterThan { get => this._daysAfterLastTierChangeGreaterThan; set => this._daysAfterLastTierChangeGreaterThan = value; } + + /// Creates an new instance. + public DateAfterCreation() + { + + } + } + /// Object to define snapshot and version action conditions. + public partial interface IDateAfterCreation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float DaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DaysAfterLastTierChangeGreaterThan { get; set; } + + } + /// Object to define snapshot and version action conditions. + internal partial interface IDateAfterCreationInternal + + { + /// Value indicating the age in days after creation + float DaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? DaysAfterLastTierChangeGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.json.cs new file mode 100644 index 000000000000..753f47b186ac --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterCreation.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Object to define snapshot and version action conditions. + public partial class DateAfterCreation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal DateAfterCreation(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_daysAfterCreationGreaterThan = If( json?.PropertyT("daysAfterCreationGreaterThan"), out var __jsonDaysAfterCreationGreaterThan) ? (float)__jsonDaysAfterCreationGreaterThan : DaysAfterCreationGreaterThan;} + {_daysAfterLastTierChangeGreaterThan = If( json?.PropertyT("daysAfterLastTierChangeGreaterThan"), out var __jsonDaysAfterLastTierChangeGreaterThan) ? (float?)__jsonDaysAfterLastTierChangeGreaterThan : DaysAfterLastTierChangeGreaterThan;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new DateAfterCreation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber(this._daysAfterCreationGreaterThan), "daysAfterCreationGreaterThan" ,container.Add ); + AddIf( null != this._daysAfterLastTierChangeGreaterThan ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((float)this._daysAfterLastTierChangeGreaterThan) : null, "daysAfterLastTierChangeGreaterThan" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.PowerShell.cs new file mode 100644 index 000000000000..8f26074ff37c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan + /// and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable + /// for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction + /// with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. + /// + [System.ComponentModel.TypeConverter(typeof(DateAfterModificationTypeConverter))] + public partial class DateAfterModification + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DateAfterModification(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DateAfterModification(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("DaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)this).DaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DateAfterModification(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DateAfterModification(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan + /// and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable + /// for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction + /// with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. + [System.ComponentModel.TypeConverter(typeof(DateAfterModificationTypeConverter))] + public partial interface IDateAfterModification + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.TypeConverter.cs new file mode 100644 index 000000000000..b84953f98cf6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DateAfterModificationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DateAfterModification.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DateAfterModification.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DateAfterModification.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.cs new file mode 100644 index 000000000000..032c8327126d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan + /// and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable + /// for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction + /// with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. + /// + public partial class DateAfterModification : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal + { + + /// Backing field for property. + private float? _daysAfterCreationGreaterThan; + + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float? DaysAfterCreationGreaterThan { get => this._daysAfterCreationGreaterThan; set => this._daysAfterCreationGreaterThan = value; } + + /// Backing field for property. + private float? _daysAfterLastAccessTimeGreaterThan; + + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float? DaysAfterLastAccessTimeGreaterThan { get => this._daysAfterLastAccessTimeGreaterThan; set => this._daysAfterLastAccessTimeGreaterThan = value; } + + /// Backing field for property. + private float? _daysAfterLastTierChangeGreaterThan; + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float? DaysAfterLastTierChangeGreaterThan { get => this._daysAfterLastTierChangeGreaterThan; set => this._daysAfterLastTierChangeGreaterThan = value; } + + /// Backing field for property. + private float? _daysAfterModificationGreaterThan; + + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public float? DaysAfterModificationGreaterThan { get => this._daysAfterModificationGreaterThan; set => this._daysAfterModificationGreaterThan = value; } + + /// Creates an new instance. + public DateAfterModification() + { + + } + } + /// Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan + /// and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable + /// for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction + /// with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. + public partial interface IDateAfterModification : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after blob creation.", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy", + SerializedName = @"daysAfterLastAccessTimeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last modification", + SerializedName = @"daysAfterModificationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DaysAfterModificationGreaterThan { get; set; } + + } + /// Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan + /// and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable + /// for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction + /// with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. + internal partial interface IDateAfterModificationInternal + + { + /// Value indicating the age in days after blob creation. + float? DaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + float? DaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + float? DaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? DaysAfterModificationGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.json.cs new file mode 100644 index 000000000000..3aa014ceba34 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DateAfterModification.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Object to define the base blob action conditions. Properties daysAfterModificationGreaterThan, daysAfterLastAccessTimeGreaterThan + /// and daysAfterCreationGreaterThan are mutually exclusive. The daysAfterLastTierChangeGreaterThan property is only applicable + /// for tierToArchive actions which requires daysAfterModificationGreaterThan to be set, also it cannot be used in conjunction + /// with daysAfterLastAccessTimeGreaterThan or daysAfterCreationGreaterThan. + /// + public partial class DateAfterModification + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal DateAfterModification(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_daysAfterModificationGreaterThan = If( json?.PropertyT("daysAfterModificationGreaterThan"), out var __jsonDaysAfterModificationGreaterThan) ? (float?)__jsonDaysAfterModificationGreaterThan : DaysAfterModificationGreaterThan;} + {_daysAfterLastAccessTimeGreaterThan = If( json?.PropertyT("daysAfterLastAccessTimeGreaterThan"), out var __jsonDaysAfterLastAccessTimeGreaterThan) ? (float?)__jsonDaysAfterLastAccessTimeGreaterThan : DaysAfterLastAccessTimeGreaterThan;} + {_daysAfterLastTierChangeGreaterThan = If( json?.PropertyT("daysAfterLastTierChangeGreaterThan"), out var __jsonDaysAfterLastTierChangeGreaterThan) ? (float?)__jsonDaysAfterLastTierChangeGreaterThan : DaysAfterLastTierChangeGreaterThan;} + {_daysAfterCreationGreaterThan = If( json?.PropertyT("daysAfterCreationGreaterThan"), out var __jsonDaysAfterCreationGreaterThan) ? (float?)__jsonDaysAfterCreationGreaterThan : DaysAfterCreationGreaterThan;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new DateAfterModification(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._daysAfterModificationGreaterThan ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((float)this._daysAfterModificationGreaterThan) : null, "daysAfterModificationGreaterThan" ,container.Add ); + AddIf( null != this._daysAfterLastAccessTimeGreaterThan ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((float)this._daysAfterLastAccessTimeGreaterThan) : null, "daysAfterLastAccessTimeGreaterThan" ,container.Add ); + AddIf( null != this._daysAfterLastTierChangeGreaterThan ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((float)this._daysAfterLastTierChangeGreaterThan) : null, "daysAfterLastTierChangeGreaterThan" ,container.Add ); + AddIf( null != this._daysAfterCreationGreaterThan ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((float)this._daysAfterCreationGreaterThan) : null, "daysAfterCreationGreaterThan" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.PowerShell.cs new file mode 100644 index 000000000000..505e5ac5394e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The service properties for soft delete. + [System.ComponentModel.TypeConverter(typeof(DeleteRetentionPolicyTypeConverter))] + public partial class DeleteRetentionPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeleteRetentionPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).AllowPermanentDelete = (bool?) content.GetValueForProperty("AllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).AllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeleteRetentionPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).AllowPermanentDelete = (bool?) content.GetValueForProperty("AllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)this).AllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeleteRetentionPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeleteRetentionPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The service properties for soft delete. + [System.ComponentModel.TypeConverter(typeof(DeleteRetentionPolicyTypeConverter))] + public partial interface IDeleteRetentionPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.TypeConverter.cs new file mode 100644 index 000000000000..d5a4cf8457f8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeleteRetentionPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeleteRetentionPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeleteRetentionPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeleteRetentionPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.cs new file mode 100644 index 000000000000..d54d2d6d47bb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The service properties for soft delete. + public partial class DeleteRetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal + { + + /// Backing field for property. + private bool? _allowPermanentDelete; + + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowPermanentDelete { get => this._allowPermanentDelete; set => this._allowPermanentDelete = value; } + + /// Backing field for property. + private int? _day; + + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? Day { get => this._day; set => this._day = value; } + + /// Backing field for property. + private bool? _enabled; + + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public DeleteRetentionPolicy() + { + + } + } + /// The service properties for soft delete. + public partial interface IDeleteRetentionPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.", + SerializedName = @"allowPermanentDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(int) })] + int? Day { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether DeleteRetentionPolicy is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// The service properties for soft delete. + internal partial interface IDeleteRetentionPolicyInternal + + { + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + bool? AllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + int? Day { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.json.cs new file mode 100644 index 000000000000..7d86f776a7de --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeleteRetentionPolicy.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The service properties for soft delete. + public partial class DeleteRetentionPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal DeleteRetentionPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_day = If( json?.PropertyT("days"), out var __jsonDays) ? (int?)__jsonDays : Day;} + {_allowPermanentDelete = If( json?.PropertyT("allowPermanentDelete"), out var __jsonAllowPermanentDelete) ? (bool?)__jsonAllowPermanentDelete : AllowPermanentDelete;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new DeleteRetentionPolicy(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != this._day ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._day) : null, "days" ,container.Add ); + AddIf( null != this._allowPermanentDelete ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowPermanentDelete) : null, "allowPermanentDelete" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.PowerShell.cs new file mode 100644 index 000000000000..b179f01a9d98 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Deleted storage account + [System.ComponentModel.TypeConverter(typeof(DeletedAccountTypeConverter))] + public partial class DeletedAccount + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeletedAccount(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).DeletionTime, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeletedAccount(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal)this).DeletionTime, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeletedAccount(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeletedAccount(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Deleted storage account + [System.ComponentModel.TypeConverter(typeof(DeletedAccountTypeConverter))] + public partial interface IDeletedAccount + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.TypeConverter.cs new file mode 100644 index 000000000000..4ca94272c9db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeletedAccountTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeletedAccount.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeletedAccount.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeletedAccount.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.cs new file mode 100644 index 000000000000..3382e8ac7a80 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Deleted storage account + public partial class DeletedAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// Creation time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).CreationTime; } + + /// Deletion time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DeletionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).DeletionTime; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Location of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).Location; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for CreationTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal.CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).CreationTime = value; } + + /// Internal Acessors for DeletionTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal.DeletionTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).DeletionTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).DeletionTime = value; } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal.Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).Location = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountProperties()); set { {_property = value;} } } + + /// Internal Acessors for RestoreReference + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal.RestoreReference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).RestoreReference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).RestoreReference = value; } + + /// Internal Acessors for StorageAccountResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountInternal.StorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).StorageAccountResourceId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).StorageAccountResourceId = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties _property; + + /// Properties of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountProperties()); set => this._property = value; } + + /// + /// Can be used to attempt recovering this deleted account via PutStorageAccount API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string RestoreReference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).RestoreReference; } + + /// Full resource id of the original storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string StorageAccountResourceId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)Property).StorageAccountResourceId; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public DeletedAccount() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Deleted storage account + public partial interface IDeletedAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// Creation time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation time of the deleted account.", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(string) })] + string CreationTime { get; } + /// Deletion time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Deletion time of the deleted account.", + SerializedName = @"deletionTime", + PossibleTypes = new [] { typeof(string) })] + string DeletionTime { get; } + /// Location of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Location of the deleted account.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// + /// Can be used to attempt recovering this deleted account via PutStorageAccount API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Can be used to attempt recovering this deleted account via PutStorageAccount API.", + SerializedName = @"restoreReference", + PossibleTypes = new [] { typeof(string) })] + string RestoreReference { get; } + /// Full resource id of the original storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full resource id of the original storage account.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountResourceId { get; } + + } + /// Deleted storage account + internal partial interface IDeletedAccountInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// Creation time of the deleted account. + string CreationTime { get; set; } + /// Deletion time of the deleted account. + string DeletionTime { get; set; } + /// Location of the deleted account. + string Location { get; set; } + /// Properties of the deleted account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties Property { get; set; } + /// + /// Can be used to attempt recovering this deleted account via PutStorageAccount API. + /// + string RestoreReference { get; set; } + /// Full resource id of the original storage account. + string StorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.json.cs new file mode 100644 index 000000000000..8cc3a869058b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccount.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Deleted storage account + public partial class DeletedAccount + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal DeletedAccount(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new DeletedAccount(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.PowerShell.cs new file mode 100644 index 000000000000..cf85e40bc528 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The response from the List Deleted Accounts operation. + [System.ComponentModel.TypeConverter(typeof(DeletedAccountListResultTypeConverter))] + public partial class DeletedAccountListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeletedAccountListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeletedAccountListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeletedAccountListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeletedAccountListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Deleted Accounts operation. + [System.ComponentModel.TypeConverter(typeof(DeletedAccountListResultTypeConverter))] + public partial interface IDeletedAccountListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.TypeConverter.cs new file mode 100644 index 000000000000..2b625b622967 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeletedAccountListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeletedAccountListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeletedAccountListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeletedAccountListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.cs new file mode 100644 index 000000000000..48ffe96a9788 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Deleted Accounts operation. + public partial class DeletedAccountListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// + /// Request URL that can be used to query next page of deleted accounts. Returned when total number of requested deleted accounts + /// exceed maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount[] _value; + + /// Gets the list of deleted accounts and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount[] Value { get => this._value; } + + /// Creates an new instance. + public DeletedAccountListResult() + { + + } + } + /// The response from the List Deleted Accounts operation. + public partial interface IDeletedAccountListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of deleted accounts. Returned when total number of requested deleted accounts + /// exceed maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Request URL that can be used to query next page of deleted accounts. Returned when total number of requested deleted accounts exceed maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Gets the list of deleted accounts and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the list of deleted accounts and their properties.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount[] Value { get; } + + } + /// The response from the List Deleted Accounts operation. + internal partial interface IDeletedAccountListResultInternal + + { + /// + /// Request URL that can be used to query next page of deleted accounts. Returned when total number of requested deleted accounts + /// exceed maximum page size. + /// + string NextLink { get; set; } + /// Gets the list of deleted accounts and their properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.json.cs new file mode 100644 index 000000000000..ea1d0b4b32ea --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountListResult.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Deleted Accounts operation. + public partial class DeletedAccountListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal DeletedAccountListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccount.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new DeletedAccountListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.PowerShell.cs new file mode 100644 index 000000000000..ad83ccf4a313 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Attributes of a deleted storage account. + [System.ComponentModel.TypeConverter(typeof(DeletedAccountPropertiesTypeConverter))] + public partial class DeletedAccountProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeletedAccountProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).DeletionTime, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeletedAccountProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StorageAccountResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId = (string) content.GetValueForProperty("StorageAccountResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).StorageAccountResourceId, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("RestoreReference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).RestoreReference = (string) content.GetValueForProperty("RestoreReference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).RestoreReference, global::System.Convert.ToString); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).CreationTime = (string) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).CreationTime, global::System.Convert.ToString); + } + if (content.Contains("DeletionTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).DeletionTime = (string) content.GetValueForProperty("DeletionTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal)this).DeletionTime, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeletedAccountProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeletedAccountProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Attributes of a deleted storage account. + [System.ComponentModel.TypeConverter(typeof(DeletedAccountPropertiesTypeConverter))] + public partial interface IDeletedAccountProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.TypeConverter.cs new file mode 100644 index 000000000000..c8d6d737f8d8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeletedAccountPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeletedAccountProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeletedAccountProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeletedAccountProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.cs new file mode 100644 index 000000000000..4a2b76ef1296 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Attributes of a deleted storage account. + public partial class DeletedAccountProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal + { + + /// Backing field for property. + private string _creationTime; + + /// Creation time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string CreationTime { get => this._creationTime; } + + /// Backing field for property. + private string _deletionTime; + + /// Deletion time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DeletionTime { get => this._deletionTime; } + + /// Backing field for property. + private string _location; + + /// Location of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; } + + /// Internal Acessors for CreationTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for DeletionTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal.DeletionTime { get => this._deletionTime; set { {_deletionTime = value;} } } + + /// Internal Acessors for Location + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for RestoreReference + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal.RestoreReference { get => this._restoreReference; set { {_restoreReference = value;} } } + + /// Internal Acessors for StorageAccountResourceId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountPropertiesInternal.StorageAccountResourceId { get => this._storageAccountResourceId; set { {_storageAccountResourceId = value;} } } + + /// Backing field for property. + private string _restoreReference; + + /// + /// Can be used to attempt recovering this deleted account via PutStorageAccount API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string RestoreReference { get => this._restoreReference; } + + /// Backing field for property. + private string _storageAccountResourceId; + + /// Full resource id of the original storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string StorageAccountResourceId { get => this._storageAccountResourceId; } + + /// Creates an new instance. + public DeletedAccountProperties() + { + + } + } + /// Attributes of a deleted storage account. + public partial interface IDeletedAccountProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Creation time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation time of the deleted account.", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(string) })] + string CreationTime { get; } + /// Deletion time of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Deletion time of the deleted account.", + SerializedName = @"deletionTime", + PossibleTypes = new [] { typeof(string) })] + string DeletionTime { get; } + /// Location of the deleted account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Location of the deleted account.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; } + /// + /// Can be used to attempt recovering this deleted account via PutStorageAccount API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Can be used to attempt recovering this deleted account via PutStorageAccount API.", + SerializedName = @"restoreReference", + PossibleTypes = new [] { typeof(string) })] + string RestoreReference { get; } + /// Full resource id of the original storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Full resource id of the original storage account.", + SerializedName = @"storageAccountResourceId", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountResourceId { get; } + + } + /// Attributes of a deleted storage account. + internal partial interface IDeletedAccountPropertiesInternal + + { + /// Creation time of the deleted account. + string CreationTime { get; set; } + /// Deletion time of the deleted account. + string DeletionTime { get; set; } + /// Location of the deleted account. + string Location { get; set; } + /// + /// Can be used to attempt recovering this deleted account via PutStorageAccount API. + /// + string RestoreReference { get; set; } + /// Full resource id of the original storage account. + string StorageAccountResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.json.cs new file mode 100644 index 000000000000..22522be29ef8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedAccountProperties.json.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Attributes of a deleted storage account. + public partial class DeletedAccountProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal DeletedAccountProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_storageAccountResourceId = If( json?.PropertyT("storageAccountResourceId"), out var __jsonStorageAccountResourceId) ? (string)__jsonStorageAccountResourceId : (string)StorageAccountResourceId;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_restoreReference = If( json?.PropertyT("restoreReference"), out var __jsonRestoreReference) ? (string)__jsonRestoreReference : (string)RestoreReference;} + {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? (string)__jsonCreationTime : (string)CreationTime;} + {_deletionTime = If( json?.PropertyT("deletionTime"), out var __jsonDeletionTime) ? (string)__jsonDeletionTime : (string)DeletionTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new DeletedAccountProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._storageAccountResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._storageAccountResourceId.ToString()) : null, "storageAccountResourceId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._restoreReference)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._restoreReference.ToString()) : null, "restoreReference" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._creationTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._creationTime.ToString()) : null, "creationTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._deletionTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._deletionTime.ToString()) : null, "deletionTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.PowerShell.cs new file mode 100644 index 000000000000..efcdf966dc3a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The deleted share to be restored. + [System.ComponentModel.TypeConverter(typeof(DeletedShareTypeConverter))] + public partial class DeletedShare + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal DeletedShare(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Version, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal DeletedShare(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal)this).Version, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new DeletedShare(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new DeletedShare(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The deleted share to be restored. + [System.ComponentModel.TypeConverter(typeof(DeletedShareTypeConverter))] + public partial interface IDeletedShare + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.TypeConverter.cs new file mode 100644 index 000000000000..0ebf115ca488 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DeletedShareTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return DeletedShare.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return DeletedShare.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return DeletedShare.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.cs new file mode 100644 index 000000000000..6f8074e56a94 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The deleted share to be restored. + public partial class DeletedShare : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShareInternal + { + + /// Backing field for property. + private string _name; + + /// Required. Identify the name of the deleted share that will be restored. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _version; + + /// Required. Identify the version of the deleted share that will be restored. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public DeletedShare() + { + + } + } + /// The deleted share to be restored. + public partial interface IDeletedShare : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Required. Identify the name of the deleted share that will be restored. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Identify the name of the deleted share that will be restored.", + SerializedName = @"deletedShareName", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Required. Identify the version of the deleted share that will be restored. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Identify the version of the deleted share that will be restored.", + SerializedName = @"deletedShareVersion", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// The deleted share to be restored. + internal partial interface IDeletedShareInternal + + { + /// Required. Identify the name of the deleted share that will be restored. + string Name { get; set; } + /// Required. Identify the version of the deleted share that will be restored. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.json.cs new file mode 100644 index 000000000000..62c87152b0d8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/DeletedShare.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The deleted share to be restored. + public partial class DeletedShare + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal DeletedShare(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("deletedShareName"), out var __jsonDeletedShareName) ? (string)__jsonDeletedShareName : (string)Name;} + {_version = If( json?.PropertyT("deletedShareVersion"), out var __jsonDeletedShareVersion) ? (string)__jsonDeletedShareVersion : (string)Version;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new DeletedShare(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "deletedShareName" ,container.Add ); + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._version.ToString()) : null, "deletedShareVersion" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Dimension.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.PowerShell.cs new file mode 100644 index 000000000000..3a2e7d188203 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Dimension of blobs, possibly be blob type or access tier. + [System.ComponentModel.TypeConverter(typeof(DimensionTypeConverter))] + public partial class Dimension + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Dimension(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Dimension(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Dimension(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).DisplayName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Dimension(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal)this).DisplayName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Dimension of blobs, possibly be blob type or access tier. + [System.ComponentModel.TypeConverter(typeof(DimensionTypeConverter))] + public partial interface IDimension + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Dimension.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.TypeConverter.cs new file mode 100644 index 000000000000..103b6ba0a370 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class DimensionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Dimension.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Dimension.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Dimension.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Dimension.cs b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.cs new file mode 100644 index 000000000000..bf0bebd2f0a2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Dimension of blobs, possibly be blob type or access tier. + public partial class Dimension : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimensionInternal + { + + /// Backing field for property. + private string _displayName; + + /// Display name of dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private string _name; + + /// Display name of dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Creates an new instance. + public Dimension() + { + + } + } + /// Dimension of blobs, possibly be blob type or access tier. + public partial interface IDimension : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Display name of dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of dimension.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// Display name of dimension. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of dimension.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + + } + /// Dimension of blobs, possibly be blob type or access tier. + internal partial interface IDimensionInternal + + { + /// Display name of dimension. + string DisplayName { get; set; } + /// Display name of dimension. + string Name { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Dimension.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.json.cs new file mode 100644 index 000000000000..7c3d832cf725 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Dimension.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Dimension of blobs, possibly be blob type or access tier. + public partial class Dimension + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Dimension(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Dimension(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Encryption.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.PowerShell.cs new file mode 100644 index 000000000000..f3379c4f714f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.PowerShell.cs @@ -0,0 +1,368 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The encryption settings on the storage account. + [System.ComponentModel.TypeConverter(typeof(EncryptionTypeConverter))] + public partial class Encryption + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Encryption(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Encryption(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Encryption(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServicesTypeConverter.ConvertFrom); + } + if (content.Contains("KeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("KeySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource?) content.GetValueForProperty("KeySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource.CreateFrom); + } + if (content.Contains("RequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServiceBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceFile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceFile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceTable = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceTable, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceQueue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceQueue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyLastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityEncryptionUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity = (string) content.GetValueForProperty("IdentityEncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("IdentityEncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("IdentityEncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TableEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("QueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Encryption(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Service = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Service, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServicesTypeConverter.ConvertFrom); + } + if (content.Contains("KeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionIdentityTypeConverter.ConvertFrom); + } + if (content.Contains("KeySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource?) content.GetValueForProperty("KeySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource.CreateFrom); + } + if (content.Contains("RequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ServiceBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceFile = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceFile, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceTable = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceTable, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceQueue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("ServiceQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).ServiceQueue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("KeyVaultPropertyKeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyName = (string) content.GetValueForProperty("KeyVaultPropertyKeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion = (string) content.GetValueForProperty("KeyVaultPropertyKeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyKeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyKeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyLastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("IdentityEncryptionUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity = (string) content.GetValueForProperty("IdentityEncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("IdentityEncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("IdentityEncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).IdentityEncryptionFederatedIdentityClientId, global::System.Convert.ToString); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).BlobLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).FileLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TableEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).TableLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("QueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal)this).QueueLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The encryption settings on the storage account. + [System.ComponentModel.TypeConverter(typeof(EncryptionTypeConverter))] + public partial interface IEncryption + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Encryption.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.TypeConverter.cs new file mode 100644 index 000000000000..15b033ae438f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Encryption.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Encryption.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Encryption.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Encryption.cs b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.cs new file mode 100644 index 000000000000..ba86673b5dfb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.cs @@ -0,0 +1,572 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The encryption settings on the storage account. + public partial class Encryption : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal + { + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? BlobEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).BlobEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).BlobEnabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? BlobKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).BlobKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).BlobKeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? BlobLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).BlobLastEnabledTime; } + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).FileEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).FileEnabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? FileKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).FileKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).FileKeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? FileLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).FileLastEnabledTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity _identity; + + /// The identity to be used with service-side encryption at rest. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionIdentity()); set => this._identity = value; } + + /// + /// ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys + /// server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityEncryptionFederatedIdentityClientId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)Identity).EncryptionFederatedIdentityClientId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)Identity).EncryptionFederatedIdentityClientId = value ?? null; } + + /// + /// Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityEncryptionUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)Identity).EncryptionUserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)Identity).EncryptionUserAssignedIdentity = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource? _keySource; + + /// + /// The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource? KeySource { get => this._keySource; set => this._keySource = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties _keyVaultProperty; + + /// Properties provided by key vault. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyVaultProperties()); set => this._keyVaultProperty = value; } + + /// + /// This is a read only property that represents the expiration time of the current version of the customer managed key used + /// for encryption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyExpirationTimestamp; } + + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier; } + + /// The name of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyName = value ?? null; } + + /// The Uri of KeyVault. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVaultUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyVaultUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyVaultUri = value ?? null; } + + /// The version of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).KeyVersion = value ?? null; } + + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp; } + + /// Internal Acessors for BlobLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.BlobLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).BlobLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).BlobLastEnabledTime = value; } + + /// Internal Acessors for FileLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.FileLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).FileLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).FileLastEnabledTime = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionIdentity()); set { {_identity = value;} } } + + /// Internal Acessors for KeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyVaultProperties()); set { {_keyVaultProperty = value;} } } + + /// Internal Acessors for KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyExpirationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyExpirationTimestamp = value; } + + /// Internal Acessors for KeyVaultPropertyCurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier = value; } + + /// Internal Acessors for KeyVaultPropertyLastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp = value; } + + /// Internal Acessors for QueueLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.QueueLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).QueueLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).QueueLastEnabledTime = value; } + + /// Internal Acessors for Service + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.Service { get => (this._service = this._service ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServices()); set { {_service = value;} } } + + /// Internal Acessors for ServiceBlob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.ServiceBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).Blob = value; } + + /// Internal Acessors for ServiceFile + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.ServiceFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).File = value; } + + /// Internal Acessors for ServiceQueue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.ServiceQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).Queue = value; } + + /// Internal Acessors for ServiceTable + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.ServiceTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).Table = value; } + + /// Internal Acessors for TableLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionInternal.TableLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).TableLastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).TableLastEnabledTime = value; } + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? QueueEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).QueueEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).QueueEnabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? QueueKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).QueueKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).QueueKeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? QueueLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).QueueLastEnabledTime; } + + /// Backing field for property. + private bool? _requireInfrastructureEncryption; + + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? RequireInfrastructureEncryption { get => this._requireInfrastructureEncryption; set => this._requireInfrastructureEncryption = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices _service; + + /// List of services which support encryption. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices Service { get => (this._service = this._service ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServices()); set => this._service = value; } + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? TableEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).TableEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).TableEnabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? TableKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).TableKeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).TableKeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? TableLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)Service).TableLastEnabledTime; } + + /// Creates an new instance. + public Encryption() + { + + } + } + /// The encryption settings on the storage account. + public partial interface IEncryption : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? BlobEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? BlobKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BlobLastEnabledTime { get; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? FileEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? FileKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FileLastEnabledTime { get; } + /// + /// ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys + /// server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account.", + SerializedName = @"federatedIdentityClientId", + PossibleTypes = new [] { typeof(string) })] + string IdentityEncryptionFederatedIdentityClientId { get; set; } + /// + /// Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string IdentityEncryptionUserAssignedIdentity { get; set; } + /// + /// The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault", + SerializedName = @"keySource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource? KeySource { get; set; } + /// + /// This is a read only property that represents the expiration time of the current version of the customer managed key used + /// for encryption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption.", + SerializedName = @"currentVersionedKeyExpirationTimestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp { get; } + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The object identifier of the current versioned Key Vault Key in use.", + SerializedName = @"currentVersionedKeyIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyCurrentVersionedKeyIdentifier { get; } + /// The name of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of KeyVault key.", + SerializedName = @"keyname", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyName { get; set; } + /// The Uri of KeyVault. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Uri of KeyVault.", + SerializedName = @"keyvaulturi", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVaultUri { get; set; } + /// The version of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of KeyVault key.", + SerializedName = @"keyversion", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyVersion { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Timestamp of last rotation of the Key Vault Key.", + SerializedName = @"lastKeyRotationTimestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? QueueEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? QueueKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? QueueLastEnabledTime { get; } + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest.", + SerializedName = @"requireInfrastructureEncryption", + PossibleTypes = new [] { typeof(bool) })] + bool? RequireInfrastructureEncryption { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? TableEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? TableKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TableLastEnabledTime { get; } + + } + /// The encryption settings on the storage account. + internal partial interface IEncryptionInternal + + { + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? BlobEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? BlobKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? BlobLastEnabledTime { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? FileEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? FileKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? FileLastEnabledTime { get; set; } + /// The identity to be used with service-side encryption at rest. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity Identity { get; set; } + /// + /// ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys + /// server-side encryption on the storage account. + /// + string IdentityEncryptionFederatedIdentityClientId { get; set; } + /// + /// Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + /// + string IdentityEncryptionUserAssignedIdentity { get; set; } + /// + /// The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource? KeySource { get; set; } + /// Properties provided by key vault. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties KeyVaultProperty { get; set; } + /// + /// This is a read only property that represents the expiration time of the current version of the customer managed key used + /// for encryption. + /// + global::System.DateTime? KeyVaultPropertyCurrentVersionedKeyExpirationTimestamp { get; set; } + /// The object identifier of the current versioned Key Vault Key in use. + string KeyVaultPropertyCurrentVersionedKeyIdentifier { get; set; } + /// The name of KeyVault key. + string KeyVaultPropertyKeyName { get; set; } + /// The Uri of KeyVault. + string KeyVaultPropertyKeyVaultUri { get; set; } + /// The version of KeyVault key. + string KeyVaultPropertyKeyVersion { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? QueueEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? QueueKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? QueueLastEnabledTime { get; set; } + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + bool? RequireInfrastructureEncryption { get; set; } + /// List of services which support encryption. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices Service { get; set; } + /// The encryption function of the blob storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService ServiceBlob { get; set; } + /// The encryption function of the file storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService ServiceFile { get; set; } + /// The encryption function of the queue storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService ServiceQueue { get; set; } + /// The encryption function of the table storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService ServiceTable { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? TableEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? TableKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? TableLastEnabledTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Encryption.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.json.cs new file mode 100644 index 000000000000..020c6401a13a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Encryption.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The encryption settings on the storage account. + public partial class Encryption + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Encryption(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_service = If( json?.PropertyT("services"), out var __jsonServices) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServices.FromJson(__jsonServices) : Service;} + {_keyVaultProperty = If( json?.PropertyT("keyvaultproperties"), out var __jsonKeyvaultproperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyVaultProperties.FromJson(__jsonKeyvaultproperties) : KeyVaultProperty;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionIdentity.FromJson(__jsonIdentity) : Identity;} + {_keySource = If( json?.PropertyT("keySource"), out var __jsonKeySource) ? (string)__jsonKeySource : (string)KeySource;} + {_requireInfrastructureEncryption = If( json?.PropertyT("requireInfrastructureEncryption"), out var __jsonRequireInfrastructureEncryption) ? (bool?)__jsonRequireInfrastructureEncryption : RequireInfrastructureEncryption;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Encryption(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._service ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._service.ToJson(null,serializationMode) : null, "services" ,container.Add ); + AddIf( null != this._keyVaultProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._keyVaultProperty.ToJson(null,serializationMode) : null, "keyvaultproperties" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != (((object)this._keySource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keySource.ToString()) : null, "keySource" ,container.Add ); + AddIf( null != this._requireInfrastructureEncryption ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._requireInfrastructureEncryption) : null, "requireInfrastructureEncryption" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.PowerShell.cs new file mode 100644 index 000000000000..53db143e6aa3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Encryption identity for the storage account. + [System.ComponentModel.TypeConverter(typeof(EncryptionIdentityTypeConverter))] + public partial class EncryptionIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionIdentity(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity = (string) content.GetValueForProperty("EncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("EncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("EncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionFederatedIdentityClientId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("EncryptionUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity = (string) content.GetValueForProperty("EncryptionUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionUserAssignedIdentity, global::System.Convert.ToString); + } + if (content.Contains("EncryptionFederatedIdentityClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionFederatedIdentityClientId = (string) content.GetValueForProperty("EncryptionFederatedIdentityClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal)this).EncryptionFederatedIdentityClientId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Encryption identity for the storage account. + [System.ComponentModel.TypeConverter(typeof(EncryptionIdentityTypeConverter))] + public partial interface IEncryptionIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.TypeConverter.cs new file mode 100644 index 000000000000..75651f723cc1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.cs new file mode 100644 index 000000000000..e757fa824103 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Encryption identity for the storage account. + public partial class EncryptionIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentityInternal + { + + /// Backing field for property. + private string _encryptionFederatedIdentityClientId; + + /// + /// ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys + /// server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string EncryptionFederatedIdentityClientId { get => this._encryptionFederatedIdentityClientId; set => this._encryptionFederatedIdentityClientId = value; } + + /// Backing field for property. + private string _encryptionUserAssignedIdentity; + + /// + /// Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string EncryptionUserAssignedIdentity { get => this._encryptionUserAssignedIdentity; set => this._encryptionUserAssignedIdentity = value; } + + /// Creates an new instance. + public EncryptionIdentity() + { + + } + } + /// Encryption identity for the storage account. + public partial interface IEncryptionIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys + /// server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys server-side encryption on the storage account.", + SerializedName = @"federatedIdentityClientId", + PossibleTypes = new [] { typeof(string) })] + string EncryptionFederatedIdentityClientId { get; set; } + /// + /// Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account.", + SerializedName = @"userAssignedIdentity", + PossibleTypes = new [] { typeof(string) })] + string EncryptionUserAssignedIdentity { get; set; } + + } + /// Encryption identity for the storage account. + internal partial interface IEncryptionIdentityInternal + + { + /// + /// ClientId of the multi-tenant application to be used in conjunction with the user-assigned identity for cross-tenant customer-managed-keys + /// server-side encryption on the storage account. + /// + string EncryptionFederatedIdentityClientId { get; set; } + /// + /// Resource identifier of the UserAssigned identity to be associated with server-side encryption on the storage account. + /// + string EncryptionUserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.json.cs new file mode 100644 index 000000000000..1b0d59a9feba --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionIdentity.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Encryption identity for the storage account. + public partial class EncryptionIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionIdentity(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_encryptionUserAssignedIdentity = If( json?.PropertyT("userAssignedIdentity"), out var __jsonUserAssignedIdentity) ? (string)__jsonUserAssignedIdentity : (string)EncryptionUserAssignedIdentity;} + {_encryptionFederatedIdentityClientId = If( json?.PropertyT("federatedIdentityClientId"), out var __jsonFederatedIdentityClientId) ? (string)__jsonFederatedIdentityClientId : (string)EncryptionFederatedIdentityClientId;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new EncryptionIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._encryptionUserAssignedIdentity)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._encryptionUserAssignedIdentity.ToString()) : null, "userAssignedIdentity" ,container.Add ); + AddIf( null != (((object)this._encryptionFederatedIdentityClientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._encryptionFederatedIdentityClientId.ToString()) : null, "federatedIdentityClientId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.PowerShell.cs new file mode 100644 index 000000000000..4b15f3248dc8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.PowerShell.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Encryption Scope resource. + [System.ComponentModel.TypeConverter(typeof(EncryptionScopeTypeConverter))] + public partial class EncryptionScope + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionScope(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionScope(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionScope(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PropertyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyCreationTime = (global::System.DateTime?) content.GetValueForProperty("PropertyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyCreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("PropertyKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PropertySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("PropertySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("PropertyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("PropertyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("PropertyLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyRequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption = (bool?) content.GetValueForProperty("PropertyRequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyLastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionScope(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PropertyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyCreationTime = (global::System.DateTime?) content.GetValueForProperty("PropertyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyCreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyKeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("PropertyKeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyKeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("PropertySource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertySource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("PropertySource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertySource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("PropertyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("PropertyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("PropertyLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyRequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption = (bool?) content.GetValueForProperty("PropertyRequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).PropertyRequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal)this).KeyVaultPropertyLastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Encryption Scope resource. + [System.ComponentModel.TypeConverter(typeof(EncryptionScopeTypeConverter))] + public partial interface IEncryptionScope + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.TypeConverter.cs new file mode 100644 index 000000000000..cb465095c6fe --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionScopeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionScope.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionScope.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionScope.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.cs new file mode 100644 index 000000000000..939ea5d9a370 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Encryption Scope resource. + public partial class EncryptionScope : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyCurrentVersionedKeyIdentifier; } + + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyKeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyKeyUri = value ?? null; } + + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyLastKeyRotationTimestamp; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for KeyVaultPropertyCurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal.KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyCurrentVersionedKeyIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyCurrentVersionedKeyIdentifier = value; } + + /// Internal Acessors for KeyVaultPropertyLastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal.KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyLastKeyRotationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultPropertyLastKeyRotationTimestamp = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyCreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal.PropertyCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).CreationTime = value; } + + /// Internal Acessors for PropertyKeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal.PropertyKeyVaultProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).KeyVaultProperty = value; } + + /// Internal Acessors for PropertyLastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeInternal.PropertyLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).LastModifiedTime = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties _property; + + /// Properties of the encryption scope. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeProperties()); set => this._property = value; } + + /// Gets the creation date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertyCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).CreationTime; } + + /// Gets the last modification date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertyLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).LastModifiedTime; } + + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? PropertyRequireInfrastructureEncryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).RequireInfrastructureEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).RequireInfrastructureEncryption = value ?? default(bool); } + + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource? PropertySource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).Source; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).Source = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource)""); } + + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState? PropertyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)Property).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public EncryptionScope() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The Encryption Scope resource. + public partial interface IEncryptionScope : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The object identifier of the current versioned Key Vault Key in use.", + SerializedName = @"currentVersionedKeyIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyCurrentVersionedKeyIdentifier { get; } + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope.", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyUri { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Timestamp of last rotation of the Key Vault Key.", + SerializedName = @"lastKeyRotationTimestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get; } + /// Gets the creation date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the creation date and time of the encryption scope in UTC.", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertyCreationTime { get; } + /// Gets the last modification date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the last modification date and time of the encryption scope in UTC.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertyLastModifiedTime { get; } + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest.", + SerializedName = @"requireInfrastructureEncryption", + PossibleTypes = new [] { typeof(bool) })] + bool? PropertyRequireInfrastructureEncryption { get; set; } + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource? PropertySource { get; set; } + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState? PropertyState { get; set; } + + } + /// The Encryption Scope resource. + internal partial interface IEncryptionScopeInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// The object identifier of the current versioned Key Vault Key in use. + string KeyVaultPropertyCurrentVersionedKeyIdentifier { get; set; } + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + string KeyVaultPropertyKeyUri { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get; set; } + /// Properties of the encryption scope. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties Property { get; set; } + /// Gets the creation date and time of the encryption scope in UTC. + global::System.DateTime? PropertyCreationTime { get; set; } + /// + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties PropertyKeyVaultProperty { get; set; } + /// Gets the last modification date and time of the encryption scope in UTC. + global::System.DateTime? PropertyLastModifiedTime { get; set; } + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + bool? PropertyRequireInfrastructureEncryption { get; set; } + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource? PropertySource { get; set; } + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState? PropertyState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.json.cs new file mode 100644 index 000000000000..7931f2299529 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScope.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Encryption Scope resource. + public partial class EncryptionScope + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionScope(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new EncryptionScope(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.PowerShell.cs new file mode 100644 index 000000000000..967586cb60b3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + /// + [System.ComponentModel.TypeConverter(typeof(EncryptionScopeKeyVaultPropertiesTypeConverter))] + public partial class EncryptionScopeKeyVaultProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionScopeKeyVaultProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionScopeKeyVaultProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionScopeKeyVaultProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri = (string) content.GetValueForProperty("KeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionScopeKeyVaultProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri = (string) content.GetValueForProperty("KeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).KeyUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + [System.ComponentModel.TypeConverter(typeof(EncryptionScopeKeyVaultPropertiesTypeConverter))] + public partial interface IEncryptionScopeKeyVaultProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.TypeConverter.cs new file mode 100644 index 000000000000..b507eacb386a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionScopeKeyVaultPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionScopeKeyVaultProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionScopeKeyVaultProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionScopeKeyVaultProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.cs new file mode 100644 index 000000000000..a7153e4777a6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + /// + public partial class EncryptionScopeKeyVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal + { + + /// Backing field for property. + private string _currentVersionedKeyIdentifier; + + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string CurrentVersionedKeyIdentifier { get => this._currentVersionedKeyIdentifier; } + + /// Backing field for property. + private string _keyUri; + + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyUri { get => this._keyUri; set => this._keyUri = value; } + + /// Backing field for property. + private global::System.DateTime? _lastKeyRotationTimestamp; + + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastKeyRotationTimestamp { get => this._lastKeyRotationTimestamp; } + + /// Internal Acessors for CurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal.CurrentVersionedKeyIdentifier { get => this._currentVersionedKeyIdentifier; set { {_currentVersionedKeyIdentifier = value;} } } + + /// Internal Acessors for LastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal.LastKeyRotationTimestamp { get => this._lastKeyRotationTimestamp; set { {_lastKeyRotationTimestamp = value;} } } + + /// Creates an new instance. + public EncryptionScopeKeyVaultProperties() + { + + } + } + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + public partial interface IEncryptionScopeKeyVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The object identifier of the current versioned Key Vault Key in use.", + SerializedName = @"currentVersionedKeyIdentifier", + PossibleTypes = new [] { typeof(string) })] + string CurrentVersionedKeyIdentifier { get; } + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope.", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + string KeyUri { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Timestamp of last rotation of the Key Vault Key.", + SerializedName = @"lastKeyRotationTimestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastKeyRotationTimestamp { get; } + + } + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + internal partial interface IEncryptionScopeKeyVaultPropertiesInternal + + { + /// The object identifier of the current versioned Key Vault Key in use. + string CurrentVersionedKeyIdentifier { get; set; } + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + string KeyUri { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + global::System.DateTime? LastKeyRotationTimestamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.json.cs new file mode 100644 index 000000000000..1c21d956e311 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeKeyVaultProperties.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + /// + public partial class EncryptionScopeKeyVaultProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionScopeKeyVaultProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyUri = If( json?.PropertyT("keyUri"), out var __jsonKeyUri) ? (string)__jsonKeyUri : (string)KeyUri;} + {_currentVersionedKeyIdentifier = If( json?.PropertyT("currentVersionedKeyIdentifier"), out var __jsonCurrentVersionedKeyIdentifier) ? (string)__jsonCurrentVersionedKeyIdentifier : (string)CurrentVersionedKeyIdentifier;} + {_lastKeyRotationTimestamp = If( json?.PropertyT("lastKeyRotationTimestamp"), out var __jsonLastKeyRotationTimestamp) ? global::System.DateTime.TryParse((string)__jsonLastKeyRotationTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastKeyRotationTimestampValue) ? __jsonLastKeyRotationTimestampValue : LastKeyRotationTimestamp : LastKeyRotationTimestamp;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new EncryptionScopeKeyVaultProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyUri.ToString()) : null, "keyUri" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currentVersionedKeyIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._currentVersionedKeyIdentifier.ToString()) : null, "currentVersionedKeyIdentifier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastKeyRotationTimestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastKeyRotationTimestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastKeyRotationTimestamp" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.PowerShell.cs new file mode 100644 index 000000000000..0b3eff0f95af --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + /// + [System.ComponentModel.TypeConverter(typeof(EncryptionScopeListResultTypeConverter))] + public partial class EncryptionScopeListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionScopeListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionScopeListResult(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionScopeListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionScopeListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + [System.ComponentModel.TypeConverter(typeof(EncryptionScopeListResultTypeConverter))] + public partial interface IEncryptionScopeListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.TypeConverter.cs new file mode 100644 index 000000000000..e6fc0c14ae04 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionScopeListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionScopeListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionScopeListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionScopeListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.cs new file mode 100644 index 000000000000..600a3dc6cc0f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + /// + public partial class EncryptionScopeListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// + /// Request URL that can be used to query next page of encryption scopes. Returned when total number of requested encryption + /// scopes exceeds the maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope[] _value; + + /// List of encryption scopes requested. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope[] Value { get => this._value; } + + /// Creates an new instance. + public EncryptionScopeListResult() + { + + } + } + /// List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + public partial interface IEncryptionScopeListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of encryption scopes. Returned when total number of requested encryption + /// scopes exceeds the maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Request URL that can be used to query next page of encryption scopes. Returned when total number of requested encryption scopes exceeds the maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of encryption scopes requested. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of encryption scopes requested.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope[] Value { get; } + + } + /// List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + internal partial interface IEncryptionScopeListResultInternal + + { + /// + /// Request URL that can be used to query next page of encryption scopes. Returned when total number of requested encryption + /// scopes exceeds the maximum page size. + /// + string NextLink { get; set; } + /// List of encryption scopes requested. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.json.cs new file mode 100644 index 000000000000..5b86d250c9a9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeListResult.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// List of encryption scopes requested, and if paging is required, a URL to the next page of encryption scopes. + /// + public partial class EncryptionScopeListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionScopeListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new EncryptionScopeListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.PowerShell.cs new file mode 100644 index 000000000000..e89b1b2121e8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the encryption scope. + [System.ComponentModel.TypeConverter(typeof(EncryptionScopePropertiesTypeConverter))] + public partial class EncryptionScopeProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionScopeProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionScopeProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionScopeProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyLastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionScopeProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyVaultProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties) content.GetValueForProperty("KeyVaultProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Source")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).Source = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource?) content.GetValueForProperty("Source",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).Source, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RequireInfrastructureEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption = (bool?) content.GetValueForProperty("RequireInfrastructureEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).RequireInfrastructureEncryption, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("KeyVaultPropertyKeyUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri = (string) content.GetValueForProperty("KeyVaultPropertyKeyUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyKeyUri, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyCurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("KeyVaultPropertyCurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyCurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultPropertyLastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyLastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("KeyVaultPropertyLastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal)this).KeyVaultPropertyLastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the encryption scope. + [System.ComponentModel.TypeConverter(typeof(EncryptionScopePropertiesTypeConverter))] + public partial interface IEncryptionScopeProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.TypeConverter.cs new file mode 100644 index 000000000000..b03045feb849 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionScopePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionScopeProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionScopeProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionScopeProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.cs new file mode 100644 index 000000000000..0b4fbb815298 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the encryption scope. + public partial class EncryptionScopeProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _creationTime; + + /// Gets the creation date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? CreationTime { get => this._creationTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties _keyVaultProperty; + + /// + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultProperties()); set => this._keyVaultProperty = value; } + + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier; } + + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string KeyVaultPropertyKeyUri { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).KeyUri; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).KeyUri = value ?? null; } + + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Gets the last modification date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for KeyVaultProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal.KeyVaultProperty { get => (this._keyVaultProperty = this._keyVaultProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultProperties()); set { {_keyVaultProperty = value;} } } + + /// Internal Acessors for KeyVaultPropertyCurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal.KeyVaultPropertyCurrentVersionedKeyIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).CurrentVersionedKeyIdentifier = value; } + + /// Internal Acessors for KeyVaultPropertyLastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal.KeyVaultPropertyLastKeyRotationTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultPropertiesInternal)KeyVaultProperty).LastKeyRotationTimestamp = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopePropertiesInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Backing field for property. + private bool? _requireInfrastructureEncryption; + + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? RequireInfrastructureEncryption { get => this._requireInfrastructureEncryption; set => this._requireInfrastructureEncryption = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource? _source; + + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource? Source { get => this._source; set => this._source = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState? _state; + + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState? State { get => this._state; set => this._state = value; } + + /// Creates an new instance. + public EncryptionScopeProperties() + { + + } + } + /// Properties of the encryption scope. + public partial interface IEncryptionScopeProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets the creation date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the creation date and time of the encryption scope in UTC.", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationTime { get; } + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The object identifier of the current versioned Key Vault Key in use.", + SerializedName = @"currentVersionedKeyIdentifier", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyCurrentVersionedKeyIdentifier { get; } + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope.", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultPropertyKeyUri { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Timestamp of last rotation of the Key Vault Key.", + SerializedName = @"lastKeyRotationTimestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get; } + /// Gets the last modification date and time of the encryption scope in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the last modification date and time of the encryption scope in UTC.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest.", + SerializedName = @"requireInfrastructureEncryption", + PossibleTypes = new [] { typeof(bool) })] + bool? RequireInfrastructureEncryption { get; set; } + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource? Source { get; set; } + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState? State { get; set; } + + } + /// Properties of the encryption scope. + internal partial interface IEncryptionScopePropertiesInternal + + { + /// Gets the creation date and time of the encryption scope in UTC. + global::System.DateTime? CreationTime { get; set; } + /// + /// The key vault properties for the encryption scope. This is a required field if encryption scope 'source' attribute is + /// set to 'Microsoft.KeyVault'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeKeyVaultProperties KeyVaultProperty { get; set; } + /// The object identifier of the current versioned Key Vault Key in use. + string KeyVaultPropertyCurrentVersionedKeyIdentifier { get; set; } + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + string KeyVaultPropertyKeyUri { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + global::System.DateTime? KeyVaultPropertyLastKeyRotationTimestamp { get; set; } + /// Gets the last modification date and time of the encryption scope in UTC. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + bool? RequireInfrastructureEncryption { get; set; } + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource? Source { get; set; } + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.json.cs new file mode 100644 index 000000000000..47a22ab31160 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionScopeProperties.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the encryption scope. + public partial class EncryptionScopeProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionScopeProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyVaultProperty = If( json?.PropertyT("keyVaultProperties"), out var __jsonKeyVaultProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeKeyVaultProperties.FromJson(__jsonKeyVaultProperties) : KeyVaultProperty;} + {_source = If( json?.PropertyT("source"), out var __jsonSource) ? (string)__jsonSource : (string)Source;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? global::System.DateTime.TryParse((string)__jsonCreationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreationTimeValue) ? __jsonCreationTimeValue : CreationTime : CreationTime;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + {_requireInfrastructureEncryption = If( json?.PropertyT("requireInfrastructureEncryption"), out var __jsonRequireInfrastructureEncryption) ? (bool?)__jsonRequireInfrastructureEncryption : RequireInfrastructureEncryption;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new EncryptionScopeProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._keyVaultProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._keyVaultProperty.ToJson(null,serializationMode) : null, "keyVaultProperties" ,container.Add ); + AddIf( null != (((object)this._source)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._source.ToString()) : null, "source" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._creationTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._creationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "creationTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AddIf( null != this._requireInfrastructureEncryption ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._requireInfrastructureEncryption) : null, "requireInfrastructureEncryption" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.PowerShell.cs new file mode 100644 index 000000000000..89bf2c9fe85a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A service that allows server-side encryption to be used. + [System.ComponentModel.TypeConverter(typeof(EncryptionServiceTypeConverter))] + public partial class EncryptionService + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionService(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionService(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionService(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).LastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).KeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("KeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).KeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionService(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).LastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).KeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("KeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)this).KeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A service that allows server-side encryption to be used. + [System.ComponentModel.TypeConverter(typeof(EncryptionServiceTypeConverter))] + public partial interface IEncryptionService + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.TypeConverter.cs new file mode 100644 index 000000000000..2dadfd4ccba1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionServiceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionService.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionService.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionService.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.cs new file mode 100644 index 000000000000..4c43d179d40e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A service that allows server-side encryption to be used. + public partial class EncryptionService : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? _keyType; + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? KeyType { get => this._keyType; set => this._keyType = value; } + + /// Backing field for property. + private global::System.DateTime? _lastEnabledTime; + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastEnabledTime { get => this._lastEnabledTime; } + + /// Internal Acessors for LastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal.LastEnabledTime { get => this._lastEnabledTime; set { {_lastEnabledTime = value;} } } + + /// Creates an new instance. + public EncryptionService() + { + + } + } + /// A service that allows server-side encryption to be used. + public partial interface IEncryptionService : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? KeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastEnabledTime { get; } + + } + /// A service that allows server-side encryption to be used. + internal partial interface IEncryptionServiceInternal + + { + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? Enabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? KeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? LastEnabledTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.json.cs new file mode 100644 index 000000000000..fc2dc72b8269 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionService.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A service that allows server-side encryption to be used. + public partial class EncryptionService + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionService(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_lastEnabledTime = If( json?.PropertyT("lastEnabledTime"), out var __jsonLastEnabledTime) ? global::System.DateTime.TryParse((string)__jsonLastEnabledTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastEnabledTimeValue) ? __jsonLastEnabledTimeValue : LastEnabledTime : LastEnabledTime;} + {_keyType = If( json?.PropertyT("keyType"), out var __jsonKeyType) ? (string)__jsonKeyType : (string)KeyType;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new EncryptionService(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastEnabledTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastEnabledTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastEnabledTime" ,container.Add ); + } + AddIf( null != (((object)this._keyType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyType.ToString()) : null, "keyType" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.PowerShell.cs new file mode 100644 index 000000000000..140c880745a7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.PowerShell.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A list of services that support encryption. + [System.ComponentModel.TypeConverter(typeof(EncryptionServicesTypeConverter))] + public partial class EncryptionServices + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new EncryptionServices(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new EncryptionServices(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal EncryptionServices(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Blob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).File = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).File, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Table, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Queue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Queue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TableEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("QueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal EncryptionServices(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Blob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Blob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).File = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).File, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Table = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Table, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Queue = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).Queue, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionServiceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("BlobKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("FileKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("FileKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("TableKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("TableKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("QueueKeyType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueKeyType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType?) content.GetValueForProperty("QueueKeyType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueKeyType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType.CreateFrom); + } + if (content.Contains("BlobEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobEnabled = (bool?) content.GetValueForProperty("BlobEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("BlobLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).BlobLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("FileEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileEnabled = (bool?) content.GetValueForProperty("FileEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FileLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("FileLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).FileLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("TableEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableEnabled = (bool?) content.GetValueForProperty("TableEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TableLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("TableLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).TableLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("QueueEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueEnabled = (bool?) content.GetValueForProperty("QueueEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("QueueLastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueLastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("QueueLastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal)this).QueueLastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A list of services that support encryption. + [System.ComponentModel.TypeConverter(typeof(EncryptionServicesTypeConverter))] + public partial interface IEncryptionServices + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.TypeConverter.cs new file mode 100644 index 000000000000..ce3ed2efe5cd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EncryptionServicesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return EncryptionServices.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return EncryptionServices.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return EncryptionServices.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.cs new file mode 100644 index 000000000000..df3bf2ecf27b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A list of services that support encryption. + public partial class EncryptionServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService _blob; + + /// The encryption function of the blob storage service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Blob { get => (this._blob = this._blob ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set => this._blob = value; } + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? BlobEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Blob).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Blob).Enabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? BlobKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Blob).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Blob).KeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? BlobLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Blob).LastEnabledTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService _file; + + /// The encryption function of the file storage service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService File { get => (this._file = this._file ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set => this._file = value; } + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FileEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)File).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)File).Enabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? FileKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)File).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)File).KeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? FileLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)File).LastEnabledTime; } + + /// Internal Acessors for Blob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.Blob { get => (this._blob = this._blob ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set { {_blob = value;} } } + + /// Internal Acessors for BlobLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.BlobLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Blob).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Blob).LastEnabledTime = value; } + + /// Internal Acessors for File + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.File { get => (this._file = this._file ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set { {_file = value;} } } + + /// Internal Acessors for FileLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.FileLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)File).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)File).LastEnabledTime = value; } + + /// Internal Acessors for Queue + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.Queue { get => (this._queue = this._queue ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set { {_queue = value;} } } + + /// Internal Acessors for QueueLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.QueueLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Queue).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Queue).LastEnabledTime = value; } + + /// Internal Acessors for Table + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.Table { get => (this._table = this._table ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set { {_table = value;} } } + + /// Internal Acessors for TableLastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServicesInternal.TableLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Table).LastEnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Table).LastEnabledTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService _queue; + + /// The encryption function of the queue storage service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Queue { get => (this._queue = this._queue ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set => this._queue = value; } + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? QueueEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Queue).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Queue).Enabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? QueueKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Queue).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Queue).KeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? QueueLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Queue).LastEnabledTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService _table; + + /// The encryption function of the table storage service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Table { get => (this._table = this._table ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService()); set => this._table = value; } + + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? TableEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Table).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Table).Enabled = value ?? default(bool); } + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? TableKeyType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Table).KeyType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Table).KeyType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType)""); } + + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? TableLastEnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServiceInternal)Table).LastEnabledTime; } + + /// Creates an new instance. + public EncryptionServices() + { + + } + } + /// A list of services that support encryption. + public partial interface IEncryptionServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? BlobEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? BlobKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? BlobLastEnabledTime { get; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? FileEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? FileKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? FileLastEnabledTime { get; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? QueueEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? QueueKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? QueueLastEnabledTime { get; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default today and cannot be disabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? TableEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption key will be used. 'Service' key type implies that a default service key is used.", + SerializedName = @"keyType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? TableKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by default today and cannot be disabled.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TableLastEnabledTime { get; } + + } + /// A list of services that support encryption. + internal partial interface IEncryptionServicesInternal + + { + /// The encryption function of the blob storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Blob { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? BlobEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? BlobKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? BlobLastEnabledTime { get; set; } + /// The encryption function of the file storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService File { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? FileEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? FileKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? FileLastEnabledTime { get; set; } + /// The encryption function of the queue storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Queue { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? QueueEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? QueueKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? QueueLastEnabledTime { get; set; } + /// The encryption function of the table storage service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionService Table { get; set; } + /// + /// A boolean indicating whether or not the service encrypts the data as it is stored. Encryption at rest is enabled by default + /// today and cannot be disabled. + /// + bool? TableEnabled { get; set; } + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType? TableKeyType { get; set; } + /// + /// Gets a rough estimate of the date/time when the encryption was last enabled by the user. Data is encrypted at rest by + /// default today and cannot be disabled. + /// + global::System.DateTime? TableLastEnabledTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.json.cs new file mode 100644 index 000000000000..ef907da8aea0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/EncryptionServices.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A list of services that support encryption. + public partial class EncryptionServices + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal EncryptionServices(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_blob = If( json?.PropertyT("blob"), out var __jsonBlob) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService.FromJson(__jsonBlob) : Blob;} + {_file = If( json?.PropertyT("file"), out var __jsonFile) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService.FromJson(__jsonFile) : File;} + {_table = If( json?.PropertyT("table"), out var __jsonTable) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService.FromJson(__jsonTable) : Table;} + {_queue = If( json?.PropertyT("queue"), out var __jsonQueue) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionService.FromJson(__jsonQueue) : Queue;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionServices FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new EncryptionServices(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._blob ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._blob.ToJson(null,serializationMode) : null, "blob" ,container.Add ); + AddIf( null != this._file ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._file.ToJson(null,serializationMode) : null, "file" ,container.Add ); + AddIf( null != this._table ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._table.ToJson(null,serializationMode) : null, "table" ,container.Add ); + AddIf( null != this._queue ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._queue.ToJson(null,serializationMode) : null, "queue" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.PowerShell.cs new file mode 100644 index 000000000000..b7a003ee9e69 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.PowerShell.cs @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + /// + [System.ComponentModel.TypeConverter(typeof(EndpointsTypeConverter))] + public partial class Endpoints + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Endpoints(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Endpoints(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Endpoints(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("MicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("InternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("InternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Df, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointBlob = (string) content.GetValueForProperty("MicrosoftEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointQueue = (string) content.GetValueForProperty("MicrosoftEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointTable = (string) content.GetValueForProperty("MicrosoftEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointFile = (string) content.GetValueForProperty("MicrosoftEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointWeb = (string) content.GetValueForProperty("MicrosoftEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointDf = (string) content.GetValueForProperty("MicrosoftEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointBlob = (string) content.GetValueForProperty("InternetEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointFile = (string) content.GetValueForProperty("InternetEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointWeb = (string) content.GetValueForProperty("InternetEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointDf = (string) content.GetValueForProperty("InternetEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointDf, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Endpoints(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("MicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("InternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("InternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).Df, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointBlob = (string) content.GetValueForProperty("MicrosoftEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointQueue = (string) content.GetValueForProperty("MicrosoftEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointTable = (string) content.GetValueForProperty("MicrosoftEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointFile = (string) content.GetValueForProperty("MicrosoftEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointWeb = (string) content.GetValueForProperty("MicrosoftEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("MicrosoftEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointDf = (string) content.GetValueForProperty("MicrosoftEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).MicrosoftEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointBlob = (string) content.GetValueForProperty("InternetEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointFile = (string) content.GetValueForProperty("InternetEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointWeb = (string) content.GetValueForProperty("InternetEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("InternetEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointDf = (string) content.GetValueForProperty("InternetEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)this).InternetEndpointDf, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + [System.ComponentModel.TypeConverter(typeof(EndpointsTypeConverter))] + public partial interface IEndpoints + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.TypeConverter.cs new file mode 100644 index 000000000000..b0f4a575f4b8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class EndpointsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Endpoints.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Endpoints.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Endpoints.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.cs b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.cs new file mode 100644 index 000000000000..5c151d5585eb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.cs @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + /// + public partial class Endpoints : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal + { + + /// Backing field for property. + private string _blob; + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Blob { get => this._blob; } + + /// Backing field for property. + private string _df; + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Df { get => this._df; } + + /// Backing field for property. + private string _file; + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string File { get => this._file; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints _internetEndpoint; + + /// Gets the internet routing storage endpoints + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints InternetEndpoint { get => (this._internetEndpoint = this._internetEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpoints()); set => this._internetEndpoint = value; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string InternetEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Blob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string InternetEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Df; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string InternetEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).File; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string InternetEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Web; } + + /// Internal Acessors for Blob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.Blob { get => this._blob; set { {_blob = value;} } } + + /// Internal Acessors for Df + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.Df { get => this._df; set { {_df = value;} } } + + /// Internal Acessors for File + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.File { get => this._file; set { {_file = value;} } } + + /// Internal Acessors for InternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.InternetEndpoint { get => (this._internetEndpoint = this._internetEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpoints()); set { {_internetEndpoint = value;} } } + + /// Internal Acessors for InternetEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.InternetEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Blob = value; } + + /// Internal Acessors for InternetEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.InternetEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Df = value; } + + /// Internal Acessors for InternetEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.InternetEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).File = value; } + + /// Internal Acessors for InternetEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.InternetEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)InternetEndpoint).Web = value; } + + /// Internal Acessors for MicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.MicrosoftEndpoint { get => (this._microsoftEndpoint = this._microsoftEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpoints()); set { {_microsoftEndpoint = value;} } } + + /// Internal Acessors for MicrosoftEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.MicrosoftEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Blob = value; } + + /// Internal Acessors for MicrosoftEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.MicrosoftEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Df = value; } + + /// Internal Acessors for MicrosoftEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.MicrosoftEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).File = value; } + + /// Internal Acessors for MicrosoftEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.MicrosoftEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Queue = value; } + + /// Internal Acessors for MicrosoftEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.MicrosoftEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Table = value; } + + /// Internal Acessors for MicrosoftEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.MicrosoftEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Web = value; } + + /// Internal Acessors for Queue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.Queue { get => this._queue; set { {_queue = value;} } } + + /// Internal Acessors for Table + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.Table { get => this._table; set { {_table = value;} } } + + /// Internal Acessors for Web + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal.Web { get => this._web; set { {_web = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints _microsoftEndpoint; + + /// Gets the microsoft routing storage endpoints. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints MicrosoftEndpoint { get => (this._microsoftEndpoint = this._microsoftEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpoints()); set => this._microsoftEndpoint = value; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string MicrosoftEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Blob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string MicrosoftEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Df; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string MicrosoftEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).File; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string MicrosoftEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Queue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string MicrosoftEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Table; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string MicrosoftEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)MicrosoftEndpoint).Web; } + + /// Backing field for property. + private string _queue; + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Queue { get => this._queue; } + + /// Backing field for property. + private string _table; + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Table { get => this._table; } + + /// Backing field for property. + private string _web; + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Web { get => this._web; } + + /// Creates an new instance. + public Endpoints() + { + + } + } + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + public partial interface IEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string Blob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string Df { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string File { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string InternetEndpointBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string InternetEndpointDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string InternetEndpointFile { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string InternetEndpointWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string MicrosoftEndpointBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string MicrosoftEndpointDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string MicrosoftEndpointFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string MicrosoftEndpointQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string MicrosoftEndpointTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string MicrosoftEndpointWeb { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string Queue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string Table { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string Web { get; } + + } + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + internal partial interface IEndpointsInternal + + { + /// Gets the blob endpoint. + string Blob { get; set; } + /// Gets the dfs endpoint. + string Df { get; set; } + /// Gets the file endpoint. + string File { get; set; } + /// Gets the internet routing storage endpoints + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints InternetEndpoint { get; set; } + /// Gets the blob endpoint. + string InternetEndpointBlob { get; set; } + /// Gets the dfs endpoint. + string InternetEndpointDf { get; set; } + /// Gets the file endpoint. + string InternetEndpointFile { get; set; } + /// Gets the web endpoint. + string InternetEndpointWeb { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints MicrosoftEndpoint { get; set; } + /// Gets the blob endpoint. + string MicrosoftEndpointBlob { get; set; } + /// Gets the dfs endpoint. + string MicrosoftEndpointDf { get; set; } + /// Gets the file endpoint. + string MicrosoftEndpointFile { get; set; } + /// Gets the queue endpoint. + string MicrosoftEndpointQueue { get; set; } + /// Gets the table endpoint. + string MicrosoftEndpointTable { get; set; } + /// Gets the web endpoint. + string MicrosoftEndpointWeb { get; set; } + /// Gets the queue endpoint. + string Queue { get; set; } + /// Gets the table endpoint. + string Table { get; set; } + /// Gets the web endpoint. + string Web { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.json.cs new file mode 100644 index 000000000000..3c6a40b3d501 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Endpoints.json.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object. + /// + public partial class Endpoints + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Endpoints(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_microsoftEndpoint = If( json?.PropertyT("microsoftEndpoints"), out var __jsonMicrosoftEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpoints.FromJson(__jsonMicrosoftEndpoints) : MicrosoftEndpoint;} + {_internetEndpoint = If( json?.PropertyT("internetEndpoints"), out var __jsonInternetEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpoints.FromJson(__jsonInternetEndpoints) : InternetEndpoint;} + {_blob = If( json?.PropertyT("blob"), out var __jsonBlob) ? (string)__jsonBlob : (string)Blob;} + {_queue = If( json?.PropertyT("queue"), out var __jsonQueue) ? (string)__jsonQueue : (string)Queue;} + {_table = If( json?.PropertyT("table"), out var __jsonTable) ? (string)__jsonTable : (string)Table;} + {_file = If( json?.PropertyT("file"), out var __jsonFile) ? (string)__jsonFile : (string)File;} + {_web = If( json?.PropertyT("web"), out var __jsonWeb) ? (string)__jsonWeb : (string)Web;} + {_df = If( json?.PropertyT("dfs"), out var __jsonDfs) ? (string)__jsonDfs : (string)Df;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Endpoints(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._microsoftEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._microsoftEndpoint.ToJson(null,serializationMode) : null, "microsoftEndpoints" ,container.Add ); + AddIf( null != this._internetEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._internetEndpoint.ToJson(null,serializationMode) : null, "internetEndpoints" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._blob)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._blob.ToString()) : null, "blob" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._queue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._queue.ToString()) : null, "queue" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._table)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._table.ToString()) : null, "table" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._file)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._file.ToString()) : null, "file" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._web)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._web.ToString()) : null, "web" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._df)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._df.ToString()) : null, "dfs" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.PowerShell.cs new file mode 100644 index 000000000000..7721bdb3a26e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// An error response from the storage resource provider. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial class ErrorResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponse(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponseBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Error")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Error = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody) content.GetValueForProperty("Error",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Error, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponseBodyTypeConverter.ConvertFrom); + } + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An error response from the storage resource provider. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseTypeConverter))] + public partial interface IErrorResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.TypeConverter.cs new file mode 100644 index 000000000000..f291f3a492c7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.cs new file mode 100644 index 000000000000..d9e57ea78801 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An error response from the storage resource provider. + public partial class ErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal + { + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Code { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)Error).Code; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)Error).Code = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody _error; + + /// Azure Storage Resource Provider error response body. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponseBody()); set => this._error = value; } + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Message { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)Error).Message; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)Error).Message = value ?? null; } + + /// Internal Acessors for Error + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseInternal.Error { get => (this._error = this._error ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponseBody()); set { {_error = value;} } } + + /// Creates an new instance. + public ErrorResponse() + { + + } + } + /// An error response from the storage resource provider. + public partial interface IErrorResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// An error response from the storage resource provider. + internal partial interface IErrorResponseInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// Azure Storage Resource Provider error response body. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody Error { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.json.cs new file mode 100644 index 000000000000..10bf1ae2ffd6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponse.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An error response from the storage resource provider. + public partial class ErrorResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponse(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_error = If( json?.PropertyT("error"), out var __jsonError) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponseBody.FromJson(__jsonError) : Error;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ErrorResponse(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._error ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._error.ToJson(null,serializationMode) : null, "error" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.PowerShell.cs new file mode 100644 index 000000000000..589dba13811a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Error response body contract. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseBodyTypeConverter))] + public partial class ErrorResponseBody + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ErrorResponseBody(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ErrorResponseBody(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ErrorResponseBody(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ErrorResponseBody(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Code")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Code = (string) content.GetValueForProperty("Code",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Code, global::System.Convert.ToString); + } + if (content.Contains("Message")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Message = (string) content.GetValueForProperty("Message",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal)this).Message, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Error response body contract. + [System.ComponentModel.TypeConverter(typeof(ErrorResponseBodyTypeConverter))] + public partial interface IErrorResponseBody + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.TypeConverter.cs new file mode 100644 index 000000000000..e5059b0453ff --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ErrorResponseBodyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ErrorResponseBody.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ErrorResponseBody.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ErrorResponseBody.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.cs new file mode 100644 index 000000000000..14dd0a6dc0e2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Error response body contract. + public partial class ErrorResponseBody : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBodyInternal + { + + /// Backing field for property. + private string _code; + + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Code { get => this._code; set => this._code = value; } + + /// Backing field for property. + private string _message; + + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Message { get => this._message; set => this._message = value; } + + /// Creates an new instance. + public ErrorResponseBody() + { + + } + } + /// Error response body contract. + public partial interface IErrorResponseBody : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An identifier for the error. Codes are invariant and are intended to be consumed programmatically.", + SerializedName = @"code", + PossibleTypes = new [] { typeof(string) })] + string Code { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message describing the error, intended to be suitable for display in a user interface.", + SerializedName = @"message", + PossibleTypes = new [] { typeof(string) })] + string Message { get; set; } + + } + /// Error response body contract. + internal partial interface IErrorResponseBodyInternal + + { + /// + /// An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + /// + string Code { get; set; } + /// + /// A message describing the error, intended to be suitable for display in a user interface. + /// + string Message { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.json.cs new file mode 100644 index 000000000000..bca1cd77618e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ErrorResponseBody.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Error response body contract. + public partial class ErrorResponseBody + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ErrorResponseBody(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_code = If( json?.PropertyT("code"), out var __jsonCode) ? (string)__jsonCode : (string)Code;} + {_message = If( json?.PropertyT("message"), out var __jsonMessage) ? (string)__jsonMessage : (string)Message;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponseBody FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ErrorResponseBody(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._code)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._code.ToString()) : null, "code" ,container.Add ); + AddIf( null != (((object)this._message)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._message.ToString()) : null, "message" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.PowerShell.cs new file mode 100644 index 000000000000..84e022027bd4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The complex type of the extended location. + [System.ComponentModel.TypeConverter(typeof(ExtendedLocationTypeConverter))] + public partial class ExtendedLocation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ExtendedLocation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ExtendedLocation(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ExtendedLocation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ExtendedLocation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The complex type of the extended location. + [System.ComponentModel.TypeConverter(typeof(ExtendedLocationTypeConverter))] + public partial interface IExtendedLocation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.TypeConverter.cs new file mode 100644 index 000000000000..00bca4102500 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ExtendedLocationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ExtendedLocation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ExtendedLocation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ExtendedLocation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.cs b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.cs new file mode 100644 index 000000000000..d82f89790bd2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The complex type of the extended location. + public partial class ExtendedLocation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal + { + + /// Backing field for property. + private string _name; + + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? _type; + + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? Type { get => this._type; set => this._type = value; } + + /// Creates an new instance. + public ExtendedLocation() + { + + } + } + /// The complex type of the extended location. + public partial interface IExtendedLocation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? Type { get; set; } + + } + /// The complex type of the extended location. + internal partial interface IExtendedLocationInternal + + { + /// The name of the extended location. + string Name { get; set; } + /// The type of the extended location. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.json.cs new file mode 100644 index 000000000000..c0cd10ee4169 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ExtendedLocation.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The complex type of the extended location. + public partial class ExtendedLocation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ExtendedLocation(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ExtendedLocation(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.PowerShell.cs new file mode 100644 index 000000000000..3a14d4fef0a2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(FileServiceItemsTypeConverter))] + public partial class FileServiceItems + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileServiceItems(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileServiceItems(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileServiceItems(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileServiceItems(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(FileServiceItemsTypeConverter))] + public partial interface IFileServiceItems + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.TypeConverter.cs new file mode 100644 index 000000000000..adb1d4adfcd6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileServiceItemsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileServiceItems.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileServiceItems.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileServiceItems.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.cs new file mode 100644 index 000000000000..6c8a6286e956 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class FileServiceItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItemsInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItemsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties[] _value; + + /// List of file services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties[] Value { get => this._value; } + + /// Creates an new instance. + public FileServiceItems() + { + + } + } + public partial interface IFileServiceItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of file services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of file services returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties[] Value { get; } + + } + internal partial interface IFileServiceItemsInternal + + { + /// List of file services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.json.cs new file mode 100644 index 000000000000..8b407c6a6112 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceItems.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class FileServiceItems + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal FileServiceItems(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServiceProperties.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileServiceItems(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..686de811cbe3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.PowerShell.cs @@ -0,0 +1,304 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of File services in storage account. + [System.ComponentModel.TypeConverter(typeof(FileServicePropertiesTypeConverter))] + public partial class FileServiceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileServiceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileServiceProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileServiceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated) content.GetValueForProperty("FileServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("FileServicePropertyProtocolSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings) content.GetValueForProperty("FileServicePropertyProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("FileServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("FileServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("FileServicePropertyShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("FileServicePropertyShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileServiceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("FileServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated) content.GetValueForProperty("FileServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("FileServicePropertyProtocolSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings) content.GetValueForProperty("FileServicePropertyProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("FileServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("FileServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("FileServicePropertyShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("FileServicePropertyShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).FileServicePropertyShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of File services in storage account. + [System.ComponentModel.TypeConverter(typeof(FileServicePropertiesTypeConverter))] + public partial interface IFileServiceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..8173999d7a7d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileServicePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileServiceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileServiceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileServiceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.cs new file mode 100644 index 000000000000..5d928b76177b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.cs @@ -0,0 +1,352 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of File services in storage account. + public partial class FileServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).CorCorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).CorCorsRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated _fileServiceProperty; + + /// The properties of File services in storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated FileServiceProperty { get => (this._fileServiceProperty = this._fileServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServicePropertiesAutoGenerated()); set => this._fileServiceProperty = value; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for FileServiceProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.FileServiceProperty { get => (this._fileServiceProperty = this._fileServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServicePropertiesAutoGenerated()); set { {_fileServiceProperty = value;} } } + + /// Internal Acessors for FileServicePropertyCor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.FileServicePropertyCor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).Cor = value; } + + /// Internal Acessors for FileServicePropertyProtocolSetting + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.FileServicePropertyProtocolSetting { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSetting; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSetting = value; } + + /// Internal Acessors for FileServicePropertyShareDeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.FileServicePropertyShareDeleteRetentionPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicy = value; } + + /// Internal Acessors for ProtocolSettingSmb + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.ProtocolSettingSmb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSettingSmb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ProtocolSettingSmb = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier = value; } + + /// Internal Acessors for SmbMultichannel + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesInternal.SmbMultichannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbMultichannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbMultichannel = value; } + + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? MultichannelEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).MultichannelEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).MultichannelEnabled = value ?? default(bool); } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ShareDeleteRetentionPolicyAllowPermanentDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyAllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyAllowPermanentDelete = value ?? default(bool); } + + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ShareDeleteRetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyDay = value ?? default(int); } + + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ShareDeleteRetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).ShareDeleteRetentionPolicyEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku _sku; + + /// Sku name and tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); } + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; } + + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbAuthenticationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbAuthenticationMethod = value ?? null; } + + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbChannelEncryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbChannelEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbChannelEncryption = value ?? null; } + + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbKerberosTicketEncryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbKerberosTicketEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbKerberosTicketEncryption = value ?? null; } + + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)FileServiceProperty).SmbVersion = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public FileServiceProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The properties of File services in storage account. + public partial interface IFileServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether multichannel is enabled", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MultichannelEnabled { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.", + SerializedName = @"allowPermanentDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? ShareDeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(int) })] + int? ShareDeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether DeleteRetentionPolicy is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ShareDeleteRetentionPolicyEnabled { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; } + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter ';'.", + SerializedName = @"authenticationMethods", + PossibleTypes = new [] { typeof(string) })] + string SmbAuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'.", + SerializedName = @"channelEncryption", + PossibleTypes = new [] { typeof(string) })] + string SmbChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'", + SerializedName = @"kerberosTicketEncryption", + PossibleTypes = new [] { typeof(string) })] + string SmbKerberosTicketEncryption { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with delimiter ';'.", + SerializedName = @"versions", + PossibleTypes = new [] { typeof(string) })] + string SmbVersion { get; set; } + + } + /// The properties of File services in storage account. + internal partial interface IFileServicePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// The properties of File services in storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated FileServiceProperty { get; set; } + /// + /// Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules FileServicePropertyCor { get; set; } + /// Protocol settings for file service + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings FileServicePropertyProtocolSetting { get; set; } + /// The file service properties for share soft delete. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy FileServicePropertyShareDeleteRetentionPolicy { get; set; } + /// Indicates whether multichannel is enabled + bool? MultichannelEnabled { get; set; } + /// Setting for SMB protocol + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting ProtocolSettingSmb { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + bool? ShareDeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + int? ShareDeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + bool? ShareDeleteRetentionPolicyEnabled { get; set; } + /// Sku name and tier. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; set; } + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + string SmbAuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + string SmbChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + string SmbKerberosTicketEncryption { get; set; } + /// Multichannel setting. Applies to Premium FileStorage only. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel SmbMultichannel { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + string SmbVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.json.cs new file mode 100644 index 000000000000..8c0350267b86 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServiceProperties.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of File services in storage account. + public partial class FileServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal FileServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_fileServiceProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServicePropertiesAutoGenerated.FromJson(__jsonProperties) : FileServiceProperty;} + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku.FromJson(__jsonSku) : Sku;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileServiceProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._fileServiceProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._fileServiceProperty.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..58881ca2904d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.PowerShell.cs @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of File services in storage account. + [System.ComponentModel.TypeConverter(typeof(FileServicePropertiesAutoGeneratedTypeConverter))] + public partial class FileServicePropertiesAutoGenerated + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileServicePropertiesAutoGenerated(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileServicePropertiesAutoGenerated(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileServicePropertiesAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("ShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ProtocolSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings) content.GetValueForProperty("ProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileServicePropertiesAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("ShareDeleteRetentionPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy) content.GetValueForProperty("ShareDeleteRetentionPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("ProtocolSetting")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings) content.GetValueForProperty("ProtocolSetting",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSetting, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtocolSettingsTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("ShareDeleteRetentionPolicyEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ShareDeleteRetentionPolicyDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay = (int?) content.GetValueForProperty("ShareDeleteRetentionPolicyDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ShareDeleteRetentionPolicyAllowPermanentDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete = (bool?) content.GetValueForProperty("ShareDeleteRetentionPolicyAllowPermanentDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ShareDeleteRetentionPolicyAllowPermanentDelete, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtocolSettingSmb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting) content.GetValueForProperty("ProtocolSettingSmb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).ProtocolSettingSmb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of File services in storage account. + [System.ComponentModel.TypeConverter(typeof(FileServicePropertiesAutoGeneratedTypeConverter))] + public partial interface IFileServicePropertiesAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..44878ffbe951 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileServicePropertiesAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileServicePropertiesAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileServicePropertiesAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileServicePropertiesAutoGenerated.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..1077452d807b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.cs @@ -0,0 +1,272 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of File services in storage account. + public partial class FileServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules _cor; + + /// + /// Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set => this._cor = value; } + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set { {_cor = value;} } } + + /// Internal Acessors for ProtocolSetting + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal.ProtocolSetting { get => (this._protocolSetting = this._protocolSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtocolSettings()); set { {_protocolSetting = value;} } } + + /// Internal Acessors for ProtocolSettingSmb + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal.ProtocolSettingSmb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).Smb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).Smb = value; } + + /// Internal Acessors for ShareDeleteRetentionPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal.ShareDeleteRetentionPolicy { get => (this._shareDeleteRetentionPolicy = this._shareDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy()); set { {_shareDeleteRetentionPolicy = value;} } } + + /// Internal Acessors for SmbMultichannel + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGeneratedInternal.SmbMultichannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbMultichannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbMultichannel = value; } + + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? MultichannelEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).MultichannelEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).MultichannelEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings _protocolSetting; + + /// Protocol settings for file service + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings ProtocolSetting { get => (this._protocolSetting = this._protocolSetting ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtocolSettings()); set => this._protocolSetting = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy _shareDeleteRetentionPolicy; + + /// The file service properties for share soft delete. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy ShareDeleteRetentionPolicy { get => (this._shareDeleteRetentionPolicy = this._shareDeleteRetentionPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy()); set => this._shareDeleteRetentionPolicy = value; } + + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ShareDeleteRetentionPolicyAllowPermanentDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).AllowPermanentDelete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).AllowPermanentDelete = value ?? default(bool); } + + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ShareDeleteRetentionPolicyDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).Day; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).Day = value ?? default(int); } + + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ShareDeleteRetentionPolicyEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicyInternal)ShareDeleteRetentionPolicy).Enabled = value ?? default(bool); } + + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbAuthenticationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbAuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbAuthenticationMethod = value ?? null; } + + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbChannelEncryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbChannelEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbChannelEncryption = value ?? null; } + + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbKerberosTicketEncryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbKerberosTicketEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbKerberosTicketEncryption = value ?? null; } + + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)ProtocolSetting).SmbVersion = value ?? null; } + + /// Creates an new instance. + public FileServicePropertiesAutoGenerated() + { + + } + } + /// The properties of File services in storage account. + public partial interface IFileServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether multichannel is enabled", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MultichannelEnabled { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be used blob restore policy. This property only applies to blob service and does not apply to containers or file share.", + SerializedName = @"allowPermanentDelete", + PossibleTypes = new [] { typeof(bool) })] + bool? ShareDeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum value can be 365.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(int) })] + int? ShareDeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether DeleteRetentionPolicy is enabled.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ShareDeleteRetentionPolicyEnabled { get; set; } + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter ';'.", + SerializedName = @"authenticationMethods", + PossibleTypes = new [] { typeof(string) })] + string SmbAuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'.", + SerializedName = @"channelEncryption", + PossibleTypes = new [] { typeof(string) })] + string SmbChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'", + SerializedName = @"kerberosTicketEncryption", + PossibleTypes = new [] { typeof(string) })] + string SmbKerberosTicketEncryption { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with delimiter ';'.", + SerializedName = @"versions", + PossibleTypes = new [] { typeof(string) })] + string SmbVersion { get; set; } + + } + /// The properties of File services in storage account. + internal partial interface IFileServicePropertiesAutoGeneratedInternal + + { + /// + /// Specifies CORS rules for the File service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the File service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get; set; } + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// Indicates whether multichannel is enabled + bool? MultichannelEnabled { get; set; } + /// Protocol settings for file service + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings ProtocolSetting { get; set; } + /// Setting for SMB protocol + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting ProtocolSettingSmb { get; set; } + /// The file service properties for share soft delete. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeleteRetentionPolicy ShareDeleteRetentionPolicy { get; set; } + /// + /// This property when set to true allows deletion of the soft deleted blob versions and snapshots. This property cannot be + /// used blob restore policy. This property only applies to blob service and does not apply to containers or file share. + /// + bool? ShareDeleteRetentionPolicyAllowPermanentDelete { get; set; } + /// + /// Indicates the number of days that the deleted item should be retained. The minimum specified value can be 1 and the maximum + /// value can be 365. + /// + int? ShareDeleteRetentionPolicyDay { get; set; } + /// Indicates whether DeleteRetentionPolicy is enabled. + bool? ShareDeleteRetentionPolicyEnabled { get; set; } + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + string SmbAuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + string SmbChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + string SmbKerberosTicketEncryption { get; set; } + /// Multichannel setting. Applies to Premium FileStorage only. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel SmbMultichannel { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + string SmbVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..5a0c79abb6ac --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileServicePropertiesAutoGenerated.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of File services in storage account. + public partial class FileServicePropertiesAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal FileServicePropertiesAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cor = If( json?.PropertyT("cors"), out var __jsonCors) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules.FromJson(__jsonCors) : Cor;} + {_shareDeleteRetentionPolicy = If( json?.PropertyT("shareDeleteRetentionPolicy"), out var __jsonShareDeleteRetentionPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeleteRetentionPolicy.FromJson(__jsonShareDeleteRetentionPolicy) : ShareDeleteRetentionPolicy;} + {_protocolSetting = If( json?.PropertyT("protocolSettings"), out var __jsonProtocolSettings) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtocolSettings.FromJson(__jsonProtocolSettings) : ProtocolSetting;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServicePropertiesAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileServicePropertiesAutoGenerated(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._cor ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._cor.ToJson(null,serializationMode) : null, "cors" ,container.Add ); + AddIf( null != this._shareDeleteRetentionPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._shareDeleteRetentionPolicy.ToJson(null,serializationMode) : null, "shareDeleteRetentionPolicy" ,container.Add ); + AddIf( null != this._protocolSetting ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._protocolSetting.ToJson(null,serializationMode) : null, "protocolSettings" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShare.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.PowerShell.cs new file mode 100644 index 000000000000..2f4606ed5c66 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.PowerShell.cs @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the file share, including Id, resource name, resource type, Etag. + [System.ComponentModel.TypeConverter(typeof(FileShareTypeConverter))] + public partial class FileShare + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShare(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShare(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShare(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("PropertyMetadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) content.GetValueForProperty("PropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("PropertyShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareQuota = (int?) content.GetValueForProperty("PropertyShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyEnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyEnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("PropertyEnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyEnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("PropertyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyVersion = (string) content.GetValueForProperty("PropertyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyVersion, global::System.Convert.ToString); + } + if (content.Contains("PropertyDeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeletedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyDeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyLeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("PropertyLeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("PropertyLeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("PropertyLeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("PropertyLeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("PropertyLeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertySnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySnapshotTime = (global::System.DateTime?) content.GetValueForProperty("PropertySnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySnapshotTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyRootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("PropertyRootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("PropertyDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeleted = (bool?) content.GetValueForProperty("PropertyDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PropertyRemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRemainingRetentionDay = (int?) content.GetValueForProperty("PropertyRemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyAccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("PropertyAccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("PropertyAccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("PropertyAccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierChangeTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyAccessTierStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierStatus = (string) content.GetValueForProperty("PropertyAccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("PropertyShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareUsageByte = (long?) content.GetValueForProperty("PropertyShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShare(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("PropertyMetadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) content.GetValueForProperty("PropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("PropertyShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareQuota = (int?) content.GetValueForProperty("PropertyShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyEnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyEnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("PropertyEnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyEnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("PropertyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyVersion = (string) content.GetValueForProperty("PropertyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyVersion, global::System.Convert.ToString); + } + if (content.Contains("PropertyDeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeletedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyDeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyLeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("PropertyLeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("PropertyLeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("PropertyLeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("PropertyLeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("PropertyLeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("PropertySnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySnapshotTime = (global::System.DateTime?) content.GetValueForProperty("PropertySnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertySnapshotTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyLastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("PropertyLastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyLastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyRootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("PropertyRootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("PropertyDeleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeleted = (bool?) content.GetValueForProperty("PropertyDeleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyDeleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PropertyRemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRemainingRetentionDay = (int?) content.GetValueForProperty("PropertyRemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyRemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("PropertyAccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("PropertyAccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("PropertyAccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("PropertyAccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierChangeTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PropertyAccessTierStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierStatus = (string) content.GetValueForProperty("PropertyAccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyAccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("PropertyShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareUsageByte = (long?) content.GetValueForProperty("PropertyShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal)this).PropertyShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the file share, including Id, resource name, resource type, Etag. + [System.ComponentModel.TypeConverter(typeof(FileShareTypeConverter))] + public partial interface IFileShare + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShare.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.TypeConverter.cs new file mode 100644 index 000000000000..2d711bf103a0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileShareTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShare.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShare.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShare.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShare.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.cs new file mode 100644 index 000000000000..2af9bc3f10eb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the file share, including Id, resource name, resource type, Etag. + public partial class FileShare : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(); + + /// Resource Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyAccessTierChangeTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyAccessTierChangeTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierChangeTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierChangeTime = value; } + + /// Internal Acessors for PropertyAccessTierStatus + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyAccessTierStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierStatus = value; } + + /// Internal Acessors for PropertyDeleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Deleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Deleted = value; } + + /// Internal Acessors for PropertyDeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyDeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).DeletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).DeletedTime = value; } + + /// Internal Acessors for PropertyLastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for PropertyLeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyLeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseDuration = value; } + + /// Internal Acessors for PropertyLeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyLeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseState = value; } + + /// Internal Acessors for PropertyLeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyLeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseStatus = value; } + + /// Internal Acessors for PropertyRemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyRemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RemainingRetentionDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RemainingRetentionDay = value; } + + /// Internal Acessors for PropertyShareUsageByte + long? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyShareUsageByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareUsageByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareUsageByte = value; } + + /// Internal Acessors for PropertySnapshotTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertySnapshotTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SnapshotTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SnapshotTime = value; } + + /// Internal Acessors for PropertyVersion + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareInternal.PropertyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Version = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties _property; + + /// Properties of the file share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties()); set => this._property = value; } + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? PropertyAccessTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier)""); } + + /// Indicates the last modification time for share access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertyAccessTierChangeTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierChangeTime; } + + /// Indicates if there is a pending transition for access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PropertyAccessTierStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierStatus; } + + /// Indicates whether the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? PropertyDeleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Deleted; } + + /// The deleted time if the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertyDeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).DeletedTime; } + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? PropertyEnabledProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).EnabledProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).EnabledProtocol = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols)""); } + + /// Returns the date and time the share was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertyLastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LastModifiedTime; } + + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? PropertyLeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseDuration; } + + /// Lease state of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? PropertyLeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseState; } + + /// The lease status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? PropertyLeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseStatus; } + + /// A name-value pair to associate with the share as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata PropertyMetadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Metadata = value ?? null /* model class */; } + + /// Remaining retention days for share that was soft deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? PropertyRemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RemainingRetentionDay; } + + /// The property is for NFS share only. The default is NoRootSquash. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? PropertyRootSquash { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RootSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RootSquash = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType)""); } + + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? PropertyShareQuota { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareQuota; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareQuota = value ?? default(int); } + + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public long? PropertyShareUsageByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareUsageByte; } + + /// List of stored access policies specified on the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] PropertySignedIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SignedIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SignedIdentifier = value ?? null /* arrayOf */; } + + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? PropertySnapshotTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SnapshotTime; } + + /// The version of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PropertyVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Version; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; } + + /// Creates an new instance. + public FileShare() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureEntityResource), __azureEntityResource); + await eventListener.AssertObjectIsValid(nameof(__azureEntityResource), __azureEntityResource); + } + } + /// Properties of the file share, including Id, resource name, resource type, Etag. + public partial interface IFileShare : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource + { + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? PropertyAccessTier { get; set; } + /// Indicates the last modification time for share access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates the last modification time for share access tier.", + SerializedName = @"accessTierChangeTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertyAccessTierChangeTime { get; } + /// Indicates if there is a pending transition for access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if there is a pending transition for access tier.", + SerializedName = @"accessTierStatus", + PossibleTypes = new [] { typeof(string) })] + string PropertyAccessTierStatus { get; } + /// Indicates whether the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates whether the share was deleted.", + SerializedName = @"deleted", + PossibleTypes = new [] { typeof(bool) })] + bool? PropertyDeleted { get; } + /// The deleted time if the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The deleted time if the share was deleted.", + SerializedName = @"deletedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertyDeletedTime { get; } + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication protocol that is used for the file share. Can only be specified when creating a share.", + SerializedName = @"enabledProtocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? PropertyEnabledProtocol { get; set; } + /// Returns the date and time the share was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the share was last modified.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertyLastModifiedTime { get; } + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? PropertyLeaseDuration { get; } + /// Lease state of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Lease state of the share.", + SerializedName = @"leaseState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? PropertyLeaseState { get; } + /// The lease status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The lease status of the share.", + SerializedName = @"leaseStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? PropertyLeaseStatus { get; } + /// A name-value pair to associate with the share as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the share as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata PropertyMetadata { get; set; } + /// Remaining retention days for share that was soft deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Remaining retention days for share that was soft deleted.", + SerializedName = @"remainingRetentionDays", + PossibleTypes = new [] { typeof(int) })] + int? PropertyRemainingRetentionDay { get; } + /// The property is for NFS share only. The default is NoRootSquash. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The property is for NFS share only. The default is NoRootSquash.", + SerializedName = @"rootSquash", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? PropertyRootSquash { get; set; } + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.", + SerializedName = @"shareQuota", + PossibleTypes = new [] { typeof(int) })] + int? PropertyShareQuota { get; set; } + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files.", + SerializedName = @"shareUsageBytes", + PossibleTypes = new [] { typeof(long) })] + long? PropertyShareUsageByte { get; } + /// List of stored access policies specified on the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the share.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] PropertySignedIdentifier { get; set; } + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation time of share snapshot returned in the response of list shares with expand param ""snapshots"".", + SerializedName = @"snapshotTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? PropertySnapshotTime { get; } + /// The version of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of the share.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string PropertyVersion { get; } + + } + /// Properties of the file share, including Id, resource name, resource type, Etag. + internal partial interface IFileShareInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal + { + /// Properties of the file share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties Property { get; set; } + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? PropertyAccessTier { get; set; } + /// Indicates the last modification time for share access tier. + global::System.DateTime? PropertyAccessTierChangeTime { get; set; } + /// Indicates if there is a pending transition for access tier. + string PropertyAccessTierStatus { get; set; } + /// Indicates whether the share was deleted. + bool? PropertyDeleted { get; set; } + /// The deleted time if the share was deleted. + global::System.DateTime? PropertyDeletedTime { get; set; } + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? PropertyEnabledProtocol { get; set; } + /// Returns the date and time the share was last modified. + global::System.DateTime? PropertyLastModifiedTime { get; set; } + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? PropertyLeaseDuration { get; set; } + /// Lease state of the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? PropertyLeaseState { get; set; } + /// The lease status of the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? PropertyLeaseStatus { get; set; } + /// A name-value pair to associate with the share as metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata PropertyMetadata { get; set; } + /// Remaining retention days for share that was soft deleted. + int? PropertyRemainingRetentionDay { get; set; } + /// The property is for NFS share only. The default is NoRootSquash. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? PropertyRootSquash { get; set; } + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + int? PropertyShareQuota { get; set; } + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + long? PropertyShareUsageByte { get; set; } + /// List of stored access policies specified on the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] PropertySignedIdentifier { get; set; } + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + global::System.DateTime? PropertySnapshotTime { get; set; } + /// The version of the share. + string PropertyVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShare.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.json.cs new file mode 100644 index 000000000000..0d46cba0c9ea --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShare.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the file share, including Id, resource name, resource type, Etag. + public partial class FileShare + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal FileShare(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileShare(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureEntityResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.PowerShell.cs new file mode 100644 index 000000000000..633479c8ee3a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.PowerShell.cs @@ -0,0 +1,320 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The file share properties be listed out. + [System.ComponentModel.TypeConverter(typeof(FileShareItemTypeConverter))] + public partial class FileShareItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShareItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShareItem(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShareItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("EnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierChangeTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessTierStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SnapshotTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShareItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("EnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierChangeTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessTierStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal)this).SnapshotTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The file share properties be listed out. + [System.ComponentModel.TypeConverter(typeof(FileShareItemTypeConverter))] + public partial interface IFileShareItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.TypeConverter.cs new file mode 100644 index 000000000000..c209fa1ae795 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileShareItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShareItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShareItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShareItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.cs new file mode 100644 index 000000000000..9c0fa4eaab51 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The file share properties be listed out. + public partial class FileShareItem : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(); + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? AccessTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier)""); } + + /// Indicates the last modification time for share access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? AccessTierChangeTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierChangeTime; } + + /// Indicates if there is a pending transition for access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string AccessTierStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierStatus; } + + /// Indicates whether the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? Deleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Deleted; } + + /// The deleted time if the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? DeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).DeletedTime; } + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? EnabledProtocol { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).EnabledProtocol; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).EnabledProtocol = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols)""); } + + /// Resource Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; } + + /// Returns the date and time the share was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LastModifiedTime; } + + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseDuration; } + + /// Lease state of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseState; } + + /// The lease status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseStatus; } + + /// A name-value pair to associate with the share as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata Metadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Metadata = value ?? null /* model class */; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type = value; } + + /// Internal Acessors for AccessTierChangeTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.AccessTierChangeTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierChangeTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierChangeTime = value; } + + /// Internal Acessors for AccessTierStatus + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.AccessTierStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).AccessTierStatus = value; } + + /// Internal Acessors for Deleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.Deleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Deleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Deleted = value; } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.DeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).DeletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).DeletedTime = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for LeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.LeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseDuration = value; } + + /// Internal Acessors for LeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.LeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseState = value; } + + /// Internal Acessors for LeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.LeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).LeaseStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties()); set { {_property = value;} } } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.RemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RemainingRetentionDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RemainingRetentionDay = value; } + + /// Internal Acessors for ShareUsageByte + long? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.ShareUsageByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareUsageByte; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareUsageByte = value; } + + /// Internal Acessors for SnapshotTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.SnapshotTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SnapshotTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SnapshotTime = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Version = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties _property; + + /// The file share properties be listed out. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties()); set => this._property = value; } + + /// Remaining retention days for share that was soft deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? RemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RemainingRetentionDay; } + + /// The property is for NFS share only. The default is NoRootSquash. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? RootSquash { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RootSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).RootSquash = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType)""); } + + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ShareQuota { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareQuota; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareQuota = value ?? default(int); } + + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public long? ShareUsageByte { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).ShareUsageByte; } + + /// List of stored access policies specified on the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] SignedIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SignedIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SignedIdentifier = value ?? null /* arrayOf */; } + + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? SnapshotTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).SnapshotTime; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; } + + /// The version of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)Property).Version; } + + /// Creates an new instance. + public FileShareItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureEntityResource), __azureEntityResource); + await eventListener.AssertObjectIsValid(nameof(__azureEntityResource), __azureEntityResource); + } + } + /// The file share properties be listed out. + public partial interface IFileShareItem : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource + { + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? AccessTier { get; set; } + /// Indicates the last modification time for share access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates the last modification time for share access tier.", + SerializedName = @"accessTierChangeTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AccessTierChangeTime { get; } + /// Indicates if there is a pending transition for access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if there is a pending transition for access tier.", + SerializedName = @"accessTierStatus", + PossibleTypes = new [] { typeof(string) })] + string AccessTierStatus { get; } + /// Indicates whether the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates whether the share was deleted.", + SerializedName = @"deleted", + PossibleTypes = new [] { typeof(bool) })] + bool? Deleted { get; } + /// The deleted time if the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The deleted time if the share was deleted.", + SerializedName = @"deletedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeletedTime { get; } + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication protocol that is used for the file share. Can only be specified when creating a share.", + SerializedName = @"enabledProtocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? EnabledProtocol { get; set; } + /// Returns the date and time the share was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the share was last modified.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; } + /// Lease state of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Lease state of the share.", + SerializedName = @"leaseState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; } + /// The lease status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The lease status of the share.", + SerializedName = @"leaseStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; } + /// A name-value pair to associate with the share as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the share as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata Metadata { get; set; } + /// Remaining retention days for share that was soft deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Remaining retention days for share that was soft deleted.", + SerializedName = @"remainingRetentionDays", + PossibleTypes = new [] { typeof(int) })] + int? RemainingRetentionDay { get; } + /// The property is for NFS share only. The default is NoRootSquash. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The property is for NFS share only. The default is NoRootSquash.", + SerializedName = @"rootSquash", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? RootSquash { get; set; } + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.", + SerializedName = @"shareQuota", + PossibleTypes = new [] { typeof(int) })] + int? ShareQuota { get; set; } + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files.", + SerializedName = @"shareUsageBytes", + PossibleTypes = new [] { typeof(long) })] + long? ShareUsageByte { get; } + /// List of stored access policies specified on the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the share.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] SignedIdentifier { get; set; } + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation time of share snapshot returned in the response of list shares with expand param ""snapshots"".", + SerializedName = @"snapshotTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SnapshotTime { get; } + /// The version of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of the share.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// The file share properties be listed out. + internal partial interface IFileShareItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal + { + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? AccessTier { get; set; } + /// Indicates the last modification time for share access tier. + global::System.DateTime? AccessTierChangeTime { get; set; } + /// Indicates if there is a pending transition for access tier. + string AccessTierStatus { get; set; } + /// Indicates whether the share was deleted. + bool? Deleted { get; set; } + /// The deleted time if the share was deleted. + global::System.DateTime? DeletedTime { get; set; } + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? EnabledProtocol { get; set; } + /// Returns the date and time the share was last modified. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; set; } + /// Lease state of the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; set; } + /// The lease status of the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; set; } + /// A name-value pair to associate with the share as metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata Metadata { get; set; } + /// The file share properties be listed out. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties Property { get; set; } + /// Remaining retention days for share that was soft deleted. + int? RemainingRetentionDay { get; set; } + /// The property is for NFS share only. The default is NoRootSquash. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? RootSquash { get; set; } + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + int? ShareQuota { get; set; } + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + long? ShareUsageByte { get; set; } + /// List of stored access policies specified on the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] SignedIdentifier { get; set; } + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + global::System.DateTime? SnapshotTime { get; set; } + /// The version of the share. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.json.cs new file mode 100644 index 000000000000..95b1a125bb2b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItem.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The file share properties be listed out. + public partial class FileShareItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal FileShareItem(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileShareItem(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureEntityResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.PowerShell.cs new file mode 100644 index 000000000000..6a1c1d7e75da --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + /// + [System.ComponentModel.TypeConverter(typeof(FileShareItemsTypeConverter))] + public partial class FileShareItems + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShareItems(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShareItems(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShareItems(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShareItems(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + [System.ComponentModel.TypeConverter(typeof(FileShareItemsTypeConverter))] + public partial interface IFileShareItems + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.TypeConverter.cs new file mode 100644 index 000000000000..74bdae5fdc04 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileShareItemsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShareItems.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShareItems.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShareItems.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.cs new file mode 100644 index 000000000000..bf2871dd6af0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + /// + public partial class FileShareItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItemsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// + /// Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed maximum + /// page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem[] _value; + + /// List of file shares returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem[] Value { get => this._value; } + + /// Creates an new instance. + public FileShareItems() + { + + } + } + /// Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + public partial interface IFileShareItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed maximum + /// page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of file shares returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of file shares returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem[] Value { get; } + + } + /// Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + internal partial interface IFileShareItemsInternal + + { + /// + /// Request URL that can be used to query next page of shares. Returned when total number of requested shares exceed maximum + /// page size. + /// + string NextLink { get; set; } + /// List of file shares returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.json.cs new file mode 100644 index 000000000000..01d0af0c4622 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareItems.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Response schema. Contains list of shares returned, and if paging is requested or required, a URL to next page of shares. + /// + public partial class FileShareItems + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal FileShareItems(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItem.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileShareItems(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.PowerShell.cs new file mode 100644 index 000000000000..830376bc3e63 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.PowerShell.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of the file share. + [System.ComponentModel.TypeConverter(typeof(FileSharePropertiesTypeConverter))] + public partial class FileShareProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileShareProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileShareProperties(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileShareProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierChangeTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessTierStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SnapshotTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileShareProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ShareQuota")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareQuota = (int?) content.GetValueForProperty("ShareQuota",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareQuota, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("EnabledProtocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).EnabledProtocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols?) content.GetValueForProperty("EnabledProtocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).EnabledProtocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols.CreateFrom); + } + if (content.Contains("RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RootSquash = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType?) content.GetValueForProperty("RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RootSquash, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType.CreateFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier.CreateFrom); + } + if (content.Contains("AccessTierChangeTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierChangeTime = (global::System.DateTime?) content.GetValueForProperty("AccessTierChangeTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierChangeTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessTierStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierStatus = (string) content.GetValueForProperty("AccessTierStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).AccessTierStatus, global::System.Convert.ToString); + } + if (content.Contains("ShareUsageByte")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareUsageByte = (long?) content.GetValueForProperty("ShareUsageByte",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).ShareUsageByte, (__y)=> (long) global::System.Convert.ChangeType(__y, typeof(long))); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifierTypeConverter.ConvertFrom)); + } + if (content.Contains("SnapshotTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SnapshotTime = (global::System.DateTime?) content.GetValueForProperty("SnapshotTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal)this).SnapshotTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of the file share. + [System.ComponentModel.TypeConverter(typeof(FileSharePropertiesTypeConverter))] + public partial interface IFileShareProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.TypeConverter.cs new file mode 100644 index 000000000000..c988afd8cffa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileSharePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileShareProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileShareProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileShareProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.cs new file mode 100644 index 000000000000..34f857e3cd14 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of the file share. + public partial class FileShareProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? _accessTier; + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? AccessTier { get => this._accessTier; set => this._accessTier = value; } + + /// Backing field for property. + private global::System.DateTime? _accessTierChangeTime; + + /// Indicates the last modification time for share access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? AccessTierChangeTime { get => this._accessTierChangeTime; } + + /// Backing field for property. + private string _accessTierStatus; + + /// Indicates if there is a pending transition for access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string AccessTierStatus { get => this._accessTierStatus; } + + /// Backing field for property. + private bool? _deleted; + + /// Indicates whether the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Deleted { get => this._deleted; } + + /// Backing field for property. + private global::System.DateTime? _deletedTime; + + /// The deleted time if the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? DeletedTime { get => this._deletedTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? _enabledProtocol; + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? EnabledProtocol { get => this._enabledProtocol; set => this._enabledProtocol = value; } + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Returns the date and time the share was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? _leaseDuration; + + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get => this._leaseDuration; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? _leaseState; + + /// Lease state of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get => this._leaseState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? _leaseStatus; + + /// The lease status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get => this._leaseStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata _metadata; + + /// A name-value pair to associate with the share as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadata()); set => this._metadata = value; } + + /// Internal Acessors for AccessTierChangeTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.AccessTierChangeTime { get => this._accessTierChangeTime; set { {_accessTierChangeTime = value;} } } + + /// Internal Acessors for AccessTierStatus + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.AccessTierStatus { get => this._accessTierStatus; set { {_accessTierStatus = value;} } } + + /// Internal Acessors for Deleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.Deleted { get => this._deleted; set { {_deleted = value;} } } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.DeletedTime { get => this._deletedTime; set { {_deletedTime = value;} } } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for LeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.LeaseDuration { get => this._leaseDuration; set { {_leaseDuration = value;} } } + + /// Internal Acessors for LeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.LeaseState { get => this._leaseState; set { {_leaseState = value;} } } + + /// Internal Acessors for LeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.LeaseStatus { get => this._leaseStatus; set { {_leaseStatus = value;} } } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.RemainingRetentionDay { get => this._remainingRetentionDay; set { {_remainingRetentionDay = value;} } } + + /// Internal Acessors for ShareUsageByte + long? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.ShareUsageByte { get => this._shareUsageByte; set { {_shareUsageByte = value;} } } + + /// Internal Acessors for SnapshotTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.SnapshotTime { get => this._snapshotTime; set { {_snapshotTime = value;} } } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesInternal.Version { get => this._version; set { {_version = value;} } } + + /// Backing field for property. + private int? _remainingRetentionDay; + + /// Remaining retention days for share that was soft deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? RemainingRetentionDay { get => this._remainingRetentionDay; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? _rootSquash; + + /// The property is for NFS share only. The default is NoRootSquash. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? RootSquash { get => this._rootSquash; set => this._rootSquash = value; } + + /// Backing field for property. + private int? _shareQuota; + + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? ShareQuota { get => this._shareQuota; set => this._shareQuota = value; } + + /// Backing field for property. + private long? _shareUsageByte; + + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public long? ShareUsageByte { get => this._shareUsageByte; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] _signedIdentifier; + + /// List of stored access policies specified on the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] SignedIdentifier { get => this._signedIdentifier; set => this._signedIdentifier = value; } + + /// Backing field for property. + private global::System.DateTime? _snapshotTime; + + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? SnapshotTime { get => this._snapshotTime; } + + /// Backing field for property. + private string _version; + + /// The version of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Version { get => this._version; } + + /// Creates an new instance. + public FileShareProperties() + { + + } + } + /// The properties of the file share. + public partial interface IFileShareProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? AccessTier { get; set; } + /// Indicates the last modification time for share access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates the last modification time for share access tier.", + SerializedName = @"accessTierChangeTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AccessTierChangeTime { get; } + /// Indicates if there is a pending transition for access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates if there is a pending transition for access tier.", + SerializedName = @"accessTierStatus", + PossibleTypes = new [] { typeof(string) })] + string AccessTierStatus { get; } + /// Indicates whether the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates whether the share was deleted.", + SerializedName = @"deleted", + PossibleTypes = new [] { typeof(bool) })] + bool? Deleted { get; } + /// The deleted time if the share was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The deleted time if the share was deleted.", + SerializedName = @"deletedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeletedTime { get; } + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication protocol that is used for the file share. Can only be specified when creating a share.", + SerializedName = @"enabledProtocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? EnabledProtocol { get; set; } + /// Returns the date and time the share was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the share was last modified.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; } + /// Lease state of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Lease state of the share.", + SerializedName = @"leaseState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; } + /// The lease status of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The lease status of the share.", + SerializedName = @"leaseStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; } + /// A name-value pair to associate with the share as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the share as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata Metadata { get; set; } + /// Remaining retention days for share that was soft deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Remaining retention days for share that was soft deleted.", + SerializedName = @"remainingRetentionDays", + PossibleTypes = new [] { typeof(int) })] + int? RemainingRetentionDay { get; } + /// The property is for NFS share only. The default is NoRootSquash. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The property is for NFS share only. The default is NoRootSquash.", + SerializedName = @"rootSquash", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? RootSquash { get; set; } + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.", + SerializedName = @"shareQuota", + PossibleTypes = new [] { typeof(int) })] + int? ShareQuota { get; set; } + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files.", + SerializedName = @"shareUsageBytes", + PossibleTypes = new [] { typeof(long) })] + long? ShareUsageByte { get; } + /// List of stored access policies specified on the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the share.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] SignedIdentifier { get; set; } + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation time of share snapshot returned in the response of list shares with expand param ""snapshots"".", + SerializedName = @"snapshotTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SnapshotTime { get; } + /// The version of the share. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of the share.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// The properties of the file share. + internal partial interface IFileSharePropertiesInternal + + { + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier? AccessTier { get; set; } + /// Indicates the last modification time for share access tier. + global::System.DateTime? AccessTierChangeTime { get; set; } + /// Indicates if there is a pending transition for access tier. + string AccessTierStatus { get; set; } + /// Indicates whether the share was deleted. + bool? Deleted { get; set; } + /// The deleted time if the share was deleted. + global::System.DateTime? DeletedTime { get; set; } + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols? EnabledProtocol { get; set; } + /// Returns the date and time the share was last modified. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// Specifies whether the lease on a share is of infinite or fixed duration, only when the share is leased. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; set; } + /// Lease state of the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; set; } + /// The lease status of the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; set; } + /// A name-value pair to associate with the share as metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata Metadata { get; set; } + /// Remaining retention days for share that was soft deleted. + int? RemainingRetentionDay { get; set; } + /// The property is for NFS share only. The default is NoRootSquash. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType? RootSquash { get; set; } + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + int? ShareQuota { get; set; } + /// + /// The approximate size of the data stored on the share. Note that this value may not include all recently created or recently + /// resized files. + /// + long? ShareUsageByte { get; set; } + /// List of stored access policies specified on the share. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] SignedIdentifier { get; set; } + /// + /// Creation time of share snapshot returned in the response of list shares with expand param "snapshots". + /// + global::System.DateTime? SnapshotTime { get; set; } + /// The version of the share. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.json.cs new file mode 100644 index 000000000000..ee21a9bed460 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileShareProperties.json.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of the file share. + public partial class FileShareProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal FileShareProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + {_metadata = If( json?.PropertyT("metadata"), out var __jsonMetadata) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadata.FromJson(__jsonMetadata) : Metadata;} + {_shareQuota = If( json?.PropertyT("shareQuota"), out var __jsonShareQuota) ? (int?)__jsonShareQuota : ShareQuota;} + {_enabledProtocol = If( json?.PropertyT("enabledProtocols"), out var __jsonEnabledProtocols) ? (string)__jsonEnabledProtocols : (string)EnabledProtocol;} + {_rootSquash = If( json?.PropertyT("rootSquash"), out var __jsonRootSquash) ? (string)__jsonRootSquash : (string)RootSquash;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? (string)__jsonVersion : (string)Version;} + {_deleted = If( json?.PropertyT("deleted"), out var __jsonDeleted) ? (bool?)__jsonDeleted : Deleted;} + {_deletedTime = If( json?.PropertyT("deletedTime"), out var __jsonDeletedTime) ? global::System.DateTime.TryParse((string)__jsonDeletedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonDeletedTimeValue) ? __jsonDeletedTimeValue : DeletedTime : DeletedTime;} + {_remainingRetentionDay = If( json?.PropertyT("remainingRetentionDays"), out var __jsonRemainingRetentionDays) ? (int?)__jsonRemainingRetentionDays : RemainingRetentionDay;} + {_accessTier = If( json?.PropertyT("accessTier"), out var __jsonAccessTier) ? (string)__jsonAccessTier : (string)AccessTier;} + {_accessTierChangeTime = If( json?.PropertyT("accessTierChangeTime"), out var __jsonAccessTierChangeTime) ? global::System.DateTime.TryParse((string)__jsonAccessTierChangeTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonAccessTierChangeTimeValue) ? __jsonAccessTierChangeTimeValue : AccessTierChangeTime : AccessTierChangeTime;} + {_accessTierStatus = If( json?.PropertyT("accessTierStatus"), out var __jsonAccessTierStatus) ? (string)__jsonAccessTierStatus : (string)AccessTierStatus;} + {_shareUsageByte = If( json?.PropertyT("shareUsageBytes"), out var __jsonShareUsageBytes) ? (long?)__jsonShareUsageBytes : ShareUsageByte;} + {_leaseStatus = If( json?.PropertyT("leaseStatus"), out var __jsonLeaseStatus) ? (string)__jsonLeaseStatus : (string)LeaseStatus;} + {_leaseState = If( json?.PropertyT("leaseState"), out var __jsonLeaseState) ? (string)__jsonLeaseState : (string)LeaseState;} + {_leaseDuration = If( json?.PropertyT("leaseDuration"), out var __jsonLeaseDuration) ? (string)__jsonLeaseDuration : (string)LeaseDuration;} + {_signedIdentifier = If( json?.PropertyT("signedIdentifiers"), out var __jsonSignedIdentifiers) ? If( __jsonSignedIdentifiers as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SignedIdentifier.FromJson(__u) )) ))() : null : SignedIdentifier;} + {_snapshotTime = If( json?.PropertyT("snapshotTime"), out var __jsonSnapshotTime) ? global::System.DateTime.TryParse((string)__jsonSnapshotTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSnapshotTimeValue) ? __jsonSnapshotTimeValue : SnapshotTime : SnapshotTime;} + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileShareProperties(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AddIf( null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._metadata.ToJson(null,serializationMode) : null, "metadata" ,container.Add ); + AddIf( null != this._shareQuota ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._shareQuota) : null, "shareQuota" ,container.Add ); + AddIf( null != (((object)this._enabledProtocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._enabledProtocol.ToString()) : null, "enabledProtocols" ,container.Add ); + AddIf( null != (((object)this._rootSquash)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._rootSquash.ToString()) : null, "rootSquash" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._version.ToString()) : null, "version" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._deleted ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._deleted) : null, "deleted" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._deletedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._deletedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "deletedTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._remainingRetentionDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._remainingRetentionDay) : null, "remainingRetentionDays" ,container.Add ); + } + AddIf( null != (((object)this._accessTier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accessTier.ToString()) : null, "accessTier" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._accessTierChangeTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accessTierChangeTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "accessTierChangeTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accessTierStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accessTierStatus.ToString()) : null, "accessTierStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._shareUsageByte ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((long)this._shareUsageByte) : null, "shareUsageBytes" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._leaseStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseStatus.ToString()) : null, "leaseStatus" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._leaseState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseState.ToString()) : null, "leaseState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._leaseDuration)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseDuration.ToString()) : null, "leaseDuration" ,container.Add ); + } + if (null != this._signedIdentifier) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._signedIdentifier ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("signedIdentifiers",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._snapshotTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._snapshotTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "snapshotTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..45573a4f29bf --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A name-value pair to associate with the share as metadata. + [System.ComponentModel.TypeConverter(typeof(FileSharePropertiesMetadataTypeConverter))] + public partial class FileSharePropertiesMetadata + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new FileSharePropertiesMetadata(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new FileSharePropertiesMetadata(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal FileSharePropertiesMetadata(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal FileSharePropertiesMetadata(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A name-value pair to associate with the share as metadata. + [System.ComponentModel.TypeConverter(typeof(FileSharePropertiesMetadataTypeConverter))] + public partial interface IFileSharePropertiesMetadata + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..b39e479a10d2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class FileSharePropertiesMetadataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return FileSharePropertiesMetadata.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return FileSharePropertiesMetadata.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return FileSharePropertiesMetadata.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.cs new file mode 100644 index 000000000000..fb18838f5155 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair to associate with the share as metadata. + public partial class FileSharePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadataInternal + { + + /// Creates an new instance. + public FileSharePropertiesMetadata() + { + + } + } + /// A name-value pair to associate with the share as metadata. + public partial interface IFileSharePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// A name-value pair to associate with the share as metadata. + internal partial interface IFileSharePropertiesMetadataInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.dictionary.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..ba0f3a4b0117 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class FileSharePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileSharePropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.json.cs new file mode 100644 index 000000000000..059400b5eb34 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/FileSharePropertiesMetadata.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair to associate with the share as metadata. + public partial class FileSharePropertiesMetadata + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal FileSharePropertiesMetadata(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new FileSharePropertiesMetadata(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.PowerShell.cs new file mode 100644 index 000000000000..8f6726144fd9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when + /// geo-redundant replication is enabled for the storage account. + /// + [System.ComponentModel.TypeConverter(typeof(GeoReplicationStatsTypeConverter))] + public partial class GeoReplicationStats + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new GeoReplicationStats(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new GeoReplicationStats(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal GeoReplicationStats(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("LastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).LastSyncTime = (global::System.DateTime?) content.GetValueForProperty("LastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).LastSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CanFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).CanFailover = (bool?) content.GetValueForProperty("CanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).CanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal GeoReplicationStats(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("LastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).LastSyncTime = (global::System.DateTime?) content.GetValueForProperty("LastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).LastSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CanFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).CanFailover = (bool?) content.GetValueForProperty("CanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)this).CanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when + /// geo-redundant replication is enabled for the storage account. + [System.ComponentModel.TypeConverter(typeof(GeoReplicationStatsTypeConverter))] + public partial interface IGeoReplicationStats + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.TypeConverter.cs new file mode 100644 index 000000000000..75e626cc6f78 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class GeoReplicationStatsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return GeoReplicationStats.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return GeoReplicationStats.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return GeoReplicationStats.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.cs b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.cs new file mode 100644 index 000000000000..4a83704b9157 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when + /// geo-redundant replication is enabled for the storage account. + /// + public partial class GeoReplicationStats : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal + { + + /// Backing field for property. + private bool? _canFailover; + + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? CanFailover { get => this._canFailover; } + + /// Backing field for property. + private global::System.DateTime? _lastSyncTime; + + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastSyncTime { get => this._lastSyncTime; } + + /// Internal Acessors for CanFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal.CanFailover { get => this._canFailover; set { {_canFailover = value;} } } + + /// Internal Acessors for LastSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal.LastSyncTime { get => this._lastSyncTime; set { {_lastSyncTime = value;} } } + + /// Internal Acessors for Status + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal.Status { get => this._status; set { {_status = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? _status; + + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Status { get => this._status; } + + /// Creates an new instance. + public GeoReplicationStats() + { + + } + } + /// Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when + /// geo-redundant replication is enabled for the storage account. + public partial interface IGeoReplicationStats : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A boolean flag which indicates whether or not account failover is supported for the account.", + SerializedName = @"canFailover", + PossibleTypes = new [] { typeof(bool) })] + bool? CanFailover { get; } + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap.", + SerializedName = @"lastSyncTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastSyncTime { get; } + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Status { get; } + + } + /// Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when + /// geo-redundant replication is enabled for the storage account. + internal partial interface IGeoReplicationStatsInternal + + { + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + bool? CanFailover { get; set; } + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + global::System.DateTime? LastSyncTime { get; set; } + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.json.cs new file mode 100644 index 000000000000..3f5219b9ddf0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/GeoReplicationStats.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Statistics related to replication for storage account's Blob, Table, Queue and File services. It is only available when + /// geo-redundant replication is enabled for the storage account. + /// + public partial class GeoReplicationStats + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new GeoReplicationStats(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal GeoReplicationStats(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_lastSyncTime = If( json?.PropertyT("lastSyncTime"), out var __jsonLastSyncTime) ? global::System.DateTime.TryParse((string)__jsonLastSyncTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastSyncTimeValue) ? __jsonLastSyncTimeValue : LastSyncTime : LastSyncTime;} + {_canFailover = If( json?.PropertyT("canFailover"), out var __jsonCanFailover) ? (bool?)__jsonCanFailover : CanFailover;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastSyncTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastSyncTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastSyncTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._canFailover ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._canFailover) : null, "canFailover" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IPRule.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.PowerShell.cs new file mode 100644 index 000000000000..b9f990e1722d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// IP rule with specific IP or IP range in CIDR format. + [System.ComponentModel.TypeConverter(typeof(IPRuleTypeConverter))] + public partial class IPRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IPRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IPRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IPRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IPRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// IP rule with specific IP or IP range in CIDR format. + [System.ComponentModel.TypeConverter(typeof(IPRuleTypeConverter))] + public partial interface IIPRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IPRule.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.TypeConverter.cs new file mode 100644 index 000000000000..437a6bff9882 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IPRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IPRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IPRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IPRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IPRule.cs b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.cs new file mode 100644 index 000000000000..deb784179f41 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// IP rule with specific IP or IP range in CIDR format. + public partial class IPRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRuleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? _action; + + /// The action of IP ACL rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? Action { get => this._action; set => this._action = value; } + + /// Backing field for property. + private string _iPAddressOrRange; + + /// Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string IPAddressOrRange { get => this._iPAddressOrRange; set => this._iPAddressOrRange = value; } + + /// Creates an new instance. + public IPRule() + { + + } + } + /// IP rule with specific IP or IP range in CIDR format. + public partial interface IIPRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The action of IP ACL rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The action of IP ACL rule.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? Action { get; set; } + /// Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string IPAddressOrRange { get; set; } + + } + /// IP rule with specific IP or IP range in CIDR format. + internal partial interface IIPRuleInternal + + { + /// The action of IP ACL rule. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? Action { get; set; } + /// Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + string IPAddressOrRange { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IPRule.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.json.cs new file mode 100644 index 000000000000..0e6dabd7f796 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IPRule.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// IP rule with specific IP or IP range in CIDR format. + public partial class IPRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new IPRule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal IPRule(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_iPAddressOrRange = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)IPAddressOrRange;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._iPAddressOrRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._iPAddressOrRange.ToString()) : null, "value" ,container.Add ); + AddIf( null != (((object)this._action)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._action.ToString()) : null, "action" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Identity.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Identity.PowerShell.cs new file mode 100644 index 000000000000..320bc297156a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Identity.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Identity for the resource. + [System.ComponentModel.TypeConverter(typeof(IdentityTypeConverter))] + public partial class Identity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Identity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Identity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Identity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Identity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).Type = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).Type, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("UserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).UserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("UserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)this).UserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Identity for the resource. + [System.ComponentModel.TypeConverter(typeof(IdentityTypeConverter))] + public partial interface IIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Identity.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Identity.TypeConverter.cs new file mode 100644 index 000000000000..99377ef8cdb4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Identity.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Identity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Identity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Identity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Identity.cs b/swaggerci/storage/generated/api/Models/Api20220501/Identity.cs new file mode 100644 index 000000000000..6540019fc0cb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Identity.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Identity for the resource. + public partial class Identity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal + { + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Backing field for property. + private string _tenantId; + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType _type; + + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType Type { get => this._type; set => this._type = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities _userAssignedIdentity; + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities UserAssignedIdentity { get => (this._userAssignedIdentity = this._userAssignedIdentity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentities()); set => this._userAssignedIdentity = value; } + + /// Creates an new instance. + public Identity() + { + + } + } + /// Identity for the resource. + public partial interface IIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The identity type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType Type { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } + /// Identity for the resource. + internal partial interface IIdentityInternal + + { + /// The principal ID of resource identity. + string PrincipalId { get; set; } + /// The tenant ID of resource. + string TenantId { get; set; } + /// The identity type. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType Type { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities UserAssignedIdentity { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Identity.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Identity.json.cs new file mode 100644 index 000000000000..5a5f5d1f7224 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Identity.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Identity for the resource. + public partial class Identity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Identity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Identity(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_userAssignedIdentity = If( json?.PropertyT("userAssignedIdentities"), out var __jsonUserAssignedIdentities) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentities.FromJson(__jsonUserAssignedIdentities) : UserAssignedIdentity;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AddIf( null != this._userAssignedIdentity ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._userAssignedIdentity.ToJson(null,serializationMode) : null, "userAssignedIdentities" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.PowerShell.cs new file mode 100644 index 000000000000..b396c565fc6c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [System.ComponentModel.TypeConverter(typeof(IdentityUserAssignedIdentitiesTypeConverter))] + public partial class IdentityUserAssignedIdentities + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new IdentityUserAssignedIdentities(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new IdentityUserAssignedIdentities(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal IdentityUserAssignedIdentities(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal IdentityUserAssignedIdentities(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + [System.ComponentModel.TypeConverter(typeof(IdentityUserAssignedIdentitiesTypeConverter))] + public partial interface IIdentityUserAssignedIdentities + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.TypeConverter.cs new file mode 100644 index 000000000000..90dc3697088e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class IdentityUserAssignedIdentitiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return IdentityUserAssignedIdentities.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return IdentityUserAssignedIdentities.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return IdentityUserAssignedIdentities.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.cs b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.cs new file mode 100644 index 000000000000..ecd8fe0b6c8d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + public partial class IdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentitiesInternal + { + + /// Creates an new instance. + public IdentityUserAssignedIdentities() + { + + } + } + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + public partial interface IIdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + internal partial interface IIdentityUserAssignedIdentitiesInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.dictionary.cs b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.dictionary.cs new file mode 100644 index 000000000000..99f7451451d7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class IdentityUserAssignedIdentities : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentities source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.json.cs new file mode 100644 index 000000000000..c9e63c38877c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/IdentityUserAssignedIdentities.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + public partial class IdentityUserAssignedIdentities + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new IdentityUserAssignedIdentities(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal IdentityUserAssignedIdentities(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, (j) => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UserAssignedIdentity.FromJson(j) ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.PowerShell.cs new file mode 100644 index 000000000000..c2550e257188 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.PowerShell.cs @@ -0,0 +1,218 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + [System.ComponentModel.TypeConverter(typeof(ImmutabilityPolicyTypeConverter))] + public partial class ImmutabilityPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ImmutabilityPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ImmutabilityPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ImmutabilityPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ImmutabilityPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ETag, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + [System.ComponentModel.TypeConverter(typeof(ImmutabilityPolicyTypeConverter))] + public partial interface IImmutabilityPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.TypeConverter.cs new file mode 100644 index 000000000000..f1b6999de610 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ImmutabilityPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ImmutabilityPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ImmutabilityPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ImmutabilityPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.cs new file mode 100644 index 000000000000..ebfd92eaceb8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + public partial class ImmutabilityPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(); + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWritesAll { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWritesAll = value ?? default(bool); } + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Resource Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).ImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty()); set { {_property = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).State = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty _property; + + /// The properties of an ImmutabilityPolicy of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty()); set => this._property = value; } + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).State; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; } + + /// Creates an new instance. + public ImmutabilityPolicy() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureEntityResource), __azureEntityResource); + await eventListener.AssertObjectIsValid(nameof(__azureEntityResource), __azureEntityResource); + } + } + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + public partial interface IImmutabilityPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; } + + } + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + internal partial interface IImmutabilityPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + + string ETag { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// The properties of an ImmutabilityPolicy of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Property { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.json.cs new file mode 100644 index 000000000000..cd38c45c52b7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicy.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + public partial class ImmutabilityPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ImmutabilityPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ImmutabilityPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureEntityResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..d53d7c1d5ee4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.PowerShell.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of an ImmutabilityPolicy of a blob container. + [System.ComponentModel.TypeConverter(typeof(ImmutabilityPolicyPropertiesTypeConverter))] + public partial class ImmutabilityPolicyProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ImmutabilityPolicyProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ImmutabilityPolicyProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ImmutabilityPolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("UpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[]) content.GetValueForProperty("UpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ImmutabilityPolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("UpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[]) content.GetValueForProperty("UpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).UpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of an ImmutabilityPolicy of a blob container. + [System.ComponentModel.TypeConverter(typeof(ImmutabilityPolicyPropertiesTypeConverter))] + public partial interface IImmutabilityPolicyProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..1468758a8ff0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ImmutabilityPolicyPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ImmutabilityPolicyProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ImmutabilityPolicyProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ImmutabilityPolicyProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.cs new file mode 100644 index 000000000000..aa36cab41462 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of an ImmutabilityPolicy of a blob container. + public partial class ImmutabilityPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal + { + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWritesAll { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).AllowProtectedAppendWritesAll = value ?? default(bool); } + + /// Backing field for property. + private string _etag; + + /// ImmutabilityPolicy Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Etag { get => this._etag; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).ImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal.Etag { get => this._etag; set { {_etag = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty()); set { {_property = value;} } } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).State = value; } + + /// Internal Acessors for UpdateHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertiesInternal.UpdateHistory { get => this._updateHistory; set { {_updateHistory = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty _property; + + /// The properties of an ImmutabilityPolicy of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty()); set => this._property = value; } + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)Property).State; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] _updateHistory; + + /// The ImmutabilityPolicy update history of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] UpdateHistory { get => this._updateHistory; } + + /// Creates an new instance. + public ImmutabilityPolicyProperties() + { + + } + } + /// The properties of an ImmutabilityPolicy of a blob container. + public partial interface IImmutabilityPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + /// ImmutabilityPolicy Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ImmutabilityPolicy Etag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string Etag { get; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; } + /// The ImmutabilityPolicy update history of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy update history of the blob container.", + SerializedName = @"updateHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] UpdateHistory { get; } + + } + /// The properties of an ImmutabilityPolicy of a blob container. + internal partial interface IImmutabilityPolicyPropertiesInternal + + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + /// ImmutabilityPolicy Etag. + string Etag { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// The properties of an ImmutabilityPolicy of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Property { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; set; } + /// The ImmutabilityPolicy update history of the blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] UpdateHistory { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.json.cs new file mode 100644 index 000000000000..7a6ac26e1e9e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperties.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of an ImmutabilityPolicy of a blob container. + public partial class ImmutabilityPolicyProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ImmutabilityPolicyProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ImmutabilityPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyProperty.FromJson(__jsonProperties) : Property;} + {_etag = If( json?.PropertyT("etag"), out var __jsonEtag) ? (string)__jsonEtag : (string)Etag;} + {_updateHistory = If( json?.PropertyT("updateHistory"), out var __jsonUpdateHistory) ? If( __jsonUpdateHistory as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryProperty.FromJson(__u) )) ))() : null : UpdateHistory;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._etag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._etag.ToString()) : null, "etag" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._updateHistory) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._updateHistory ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("updateHistory",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.PowerShell.cs new file mode 100644 index 000000000000..c2173ce678c2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of an ImmutabilityPolicy of a blob container. + [System.ComponentModel.TypeConverter(typeof(ImmutabilityPolicyPropertyTypeConverter))] + public partial class ImmutabilityPolicyProperty + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ImmutabilityPolicyProperty(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ImmutabilityPolicyProperty(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ImmutabilityPolicyProperty(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ImmutabilityPolicyProperty(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of an ImmutabilityPolicy of a blob container. + [System.ComponentModel.TypeConverter(typeof(ImmutabilityPolicyPropertyTypeConverter))] + public partial interface IImmutabilityPolicyProperty + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.TypeConverter.cs new file mode 100644 index 000000000000..152dbc394be9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ImmutabilityPolicyPropertyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ImmutabilityPolicyProperty.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ImmutabilityPolicyProperty.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ImmutabilityPolicyProperty.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.cs new file mode 100644 index 000000000000..b0074163b9ce --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of an ImmutabilityPolicy of a blob container. + public partial class ImmutabilityPolicyProperty : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal + { + + /// Backing field for property. + private bool? _allowProtectedAppendWrite; + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowProtectedAppendWrite { get => this._allowProtectedAppendWrite; set => this._allowProtectedAppendWrite = value; } + + /// Backing field for property. + private bool? _allowProtectedAppendWritesAll; + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowProtectedAppendWritesAll { get => this._allowProtectedAppendWritesAll; set => this._allowProtectedAppendWritesAll = value; } + + /// Backing field for property. + private int? _immutabilityPeriodSinceCreationInDay; + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? ImmutabilityPeriodSinceCreationInDay { get => this._immutabilityPeriodSinceCreationInDay; set => this._immutabilityPeriodSinceCreationInDay = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyPropertyInternal.State { get => this._state; set { {_state = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? _state; + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get => this._state; } + + /// Creates an new instance. + public ImmutabilityPolicyProperty() + { + + } + } + /// The properties of an ImmutabilityPolicy of a blob container. + public partial interface IImmutabilityPolicyProperty : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; } + + } + /// The properties of an ImmutabilityPolicy of a blob container. + internal partial interface IImmutabilityPolicyPropertyInternal + + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.json.cs new file mode 100644 index 000000000000..f73699118fb7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutabilityPolicyProperty.json.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of an ImmutabilityPolicy of a blob container. + public partial class ImmutabilityPolicyProperty + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ImmutabilityPolicyProperty(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ImmutabilityPolicyProperty(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_immutabilityPeriodSinceCreationInDay = If( json?.PropertyT("immutabilityPeriodSinceCreationInDays"), out var __jsonImmutabilityPeriodSinceCreationInDays) ? (int?)__jsonImmutabilityPeriodSinceCreationInDays : ImmutabilityPeriodSinceCreationInDay;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + {_allowProtectedAppendWrite = If( json?.PropertyT("allowProtectedAppendWrites"), out var __jsonAllowProtectedAppendWrites) ? (bool?)__jsonAllowProtectedAppendWrites : AllowProtectedAppendWrite;} + {_allowProtectedAppendWritesAll = If( json?.PropertyT("allowProtectedAppendWritesAll"), out var __jsonAllowProtectedAppendWritesAll) ? (bool?)__jsonAllowProtectedAppendWritesAll : AllowProtectedAppendWritesAll;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._immutabilityPeriodSinceCreationInDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._immutabilityPeriodSinceCreationInDay) : null, "immutabilityPeriodSinceCreationInDays" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + } + AddIf( null != this._allowProtectedAppendWrite ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowProtectedAppendWrite) : null, "allowProtectedAppendWrites" ,container.Add ); + AddIf( null != this._allowProtectedAppendWritesAll ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowProtectedAppendWritesAll) : null, "allowProtectedAppendWritesAll" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.PowerShell.cs new file mode 100644 index 000000000000..41db88117649 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + /// + [System.ComponentModel.TypeConverter(typeof(ImmutableStorageAccountTypeConverter))] + public partial class ImmutableStorageAccount + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ImmutableStorageAccount(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ImmutableStorageAccount(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ImmutableStorageAccount(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ImmutableStorageAccount(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + [System.ComponentModel.TypeConverter(typeof(ImmutableStorageAccountTypeConverter))] + public partial interface IImmutableStorageAccount + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.TypeConverter.cs new file mode 100644 index 000000000000..aa036425de3c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ImmutableStorageAccountTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ImmutableStorageAccount.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ImmutableStorageAccount.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ImmutableStorageAccount.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.cs new file mode 100644 index 000000000000..f29fc12bc078 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + /// + public partial class ImmutableStorageAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties _immutabilityPolicy; + + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyProperties()); set => this._immutabilityPolicy = value; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutabilityPolicyAllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).AllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).ImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyPropertiesInternal)ImmutabilityPolicy).State = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Internal Acessors for ImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal.ImmutabilityPolicy { get => (this._immutabilityPolicy = this._immutabilityPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyProperties()); set { {_immutabilityPolicy = value;} } } + + /// Creates an new instance. + public ImmutableStorageAccount() + { + + } + } + /// This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + public partial interface IImmutableStorageAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + + } + /// This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + internal partial interface IImmutableStorageAccountInternal + + { + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + bool? Enabled { get; set; } + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutabilityPolicy { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.json.cs new file mode 100644 index 000000000000..4ce242253909 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageAccount.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// This property enables and defines account-level immutability. Enabling the feature auto-enables Blob Versioning. + /// + public partial class ImmutableStorageAccount + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ImmutableStorageAccount(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ImmutableStorageAccount(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_immutabilityPolicy = If( json?.PropertyT("immutabilityPolicy"), out var __jsonImmutabilityPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyProperties.FromJson(__jsonImmutabilityPolicy) : ImmutabilityPolicy;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._immutabilityPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._immutabilityPolicy.ToJson(null,serializationMode) : null, "immutabilityPolicy" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.PowerShell.cs new file mode 100644 index 000000000000..1f90cf8a82f7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Object level immutability properties of the container. + [System.ComponentModel.TypeConverter(typeof(ImmutableStorageWithVersioningTypeConverter))] + public partial class ImmutableStorageWithVersioning + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ImmutableStorageWithVersioning(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ImmutableStorageWithVersioning(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ImmutableStorageWithVersioning(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ImmutableStorageWithVersioning(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).TimeStamp = (global::System.DateTime?) content.GetValueForProperty("TimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).TimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).MigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("MigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal)this).MigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Object level immutability properties of the container. + [System.ComponentModel.TypeConverter(typeof(ImmutableStorageWithVersioningTypeConverter))] + public partial interface IImmutableStorageWithVersioning + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.TypeConverter.cs new file mode 100644 index 000000000000..c7cb01380da8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ImmutableStorageWithVersioningTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ImmutableStorageWithVersioning.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ImmutableStorageWithVersioning.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ImmutableStorageWithVersioning.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.cs new file mode 100644 index 000000000000..f6863783e67f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Object level immutability properties of the container. + public partial class ImmutableStorageWithVersioning : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Internal Acessors for MigrationState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal.MigrationState { get => this._migrationState; set { {_migrationState = value;} } } + + /// Internal Acessors for TimeStamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioningInternal.TimeStamp { get => this._timeStamp; set { {_timeStamp = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? _migrationState; + + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? MigrationState { get => this._migrationState; } + + /// Backing field for property. + private global::System.DateTime? _timeStamp; + + /// Returns the date and time the object level immutability was enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? TimeStamp { get => this._timeStamp; } + + /// Creates an new instance. + public ImmutableStorageWithVersioning() + { + + } + } + /// Object level immutability properties of the container. + public partial interface IImmutableStorageWithVersioning : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is an immutable property, when set to true it enables object level immutability at the container level.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property denotes the container level immutability to object level immutability migration state.", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? MigrationState { get; } + /// Returns the date and time the object level immutability was enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the object level immutability was enabled.", + SerializedName = @"timeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? TimeStamp { get; } + + } + /// Object level immutability properties of the container. + internal partial interface IImmutableStorageWithVersioningInternal + + { + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + bool? Enabled { get; set; } + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? MigrationState { get; set; } + /// Returns the date and time the object level immutability was enabled. + global::System.DateTime? TimeStamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.json.cs new file mode 100644 index 000000000000..07899fd60061 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ImmutableStorageWithVersioning.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Object level immutability properties of the container. + public partial class ImmutableStorageWithVersioning + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ImmutableStorageWithVersioning(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ImmutableStorageWithVersioning(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_timeStamp = If( json?.PropertyT("timeStamp"), out var __jsonTimeStamp) ? global::System.DateTime.TryParse((string)__jsonTimeStamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimeStampValue) ? __jsonTimeStampValue : TimeStamp : TimeStamp;} + {_migrationState = If( json?.PropertyT("migrationState"), out var __jsonMigrationState) ? (string)__jsonMigrationState : (string)MigrationState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._timeStamp ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._timeStamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timeStamp" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._migrationState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._migrationState.ToString()) : null, "migrationState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.PowerShell.cs new file mode 100644 index 000000000000..3bea425c0c33 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Storage account keys creation time. + [System.ComponentModel.TypeConverter(typeof(KeyCreationTimeTypeConverter))] + public partial class KeyCreationTime + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KeyCreationTime(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KeyCreationTime(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KeyCreationTime(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key1 = (global::System.DateTime?) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key1, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key2 = (global::System.DateTime?) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key2, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KeyCreationTime(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key1 = (global::System.DateTime?) content.GetValueForProperty("Key1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key1, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Key2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key2 = (global::System.DateTime?) content.GetValueForProperty("Key2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)this).Key2, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Storage account keys creation time. + [System.ComponentModel.TypeConverter(typeof(KeyCreationTimeTypeConverter))] + public partial interface IKeyCreationTime + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.TypeConverter.cs new file mode 100644 index 000000000000..caa4888a24fb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KeyCreationTimeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KeyCreationTime.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KeyCreationTime.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KeyCreationTime.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.cs new file mode 100644 index 000000000000..78bffd576108 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage account keys creation time. + public partial class KeyCreationTime : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal + { + + /// Backing field for property. + private global::System.DateTime? _key1; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? Key1 { get => this._key1; set => this._key1 = value; } + + /// Backing field for property. + private global::System.DateTime? _key2; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? Key2 { get => this._key2; set => this._key2 = value; } + + /// Creates an new instance. + public KeyCreationTime() + { + + } + } + /// Storage account keys creation time. + public partial interface IKeyCreationTime : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"key1", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Key1 { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"key2", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Key2 { get; set; } + + } + /// Storage account keys creation time. + internal partial interface IKeyCreationTimeInternal + + { + global::System.DateTime? Key1 { get; set; } + + global::System.DateTime? Key2 { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.json.cs new file mode 100644 index 000000000000..1823e55958c1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyCreationTime.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage account keys creation time. + public partial class KeyCreationTime + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new KeyCreationTime(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal KeyCreationTime(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key1 = If( json?.PropertyT("key1"), out var __jsonKey1) ? global::System.DateTime.TryParse((string)__jsonKey1, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonKey1Value) ? __jsonKey1Value : Key1 : Key1;} + {_key2 = If( json?.PropertyT("key2"), out var __jsonKey2) ? global::System.DateTime.TryParse((string)__jsonKey2, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonKey2Value) ? __jsonKey2Value : Key2 : Key2;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._key1 ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._key1?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "key1" ,container.Add ); + AddIf( null != this._key2 ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._key2?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "key2" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.PowerShell.cs new file mode 100644 index 000000000000..c5e41938b705 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// KeyPolicy assigned to the storage account. + [System.ComponentModel.TypeConverter(typeof(KeyPolicyTypeConverter))] + public partial class KeyPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KeyPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KeyPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KeyPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)this).KeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)this).KeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KeyPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)this).KeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)this).KeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// KeyPolicy assigned to the storage account. + [System.ComponentModel.TypeConverter(typeof(KeyPolicyTypeConverter))] + public partial interface IKeyPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.TypeConverter.cs new file mode 100644 index 000000000000..1e7ea271e2c2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KeyPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KeyPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KeyPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KeyPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.cs new file mode 100644 index 000000000000..fb927f344a1c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// KeyPolicy assigned to the storage account. + public partial class KeyPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal + { + + /// Backing field for property. + private int _keyExpirationPeriodInDay; + + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int KeyExpirationPeriodInDay { get => this._keyExpirationPeriodInDay; set => this._keyExpirationPeriodInDay = value; } + + /// Creates an new instance. + public KeyPolicy() + { + + } + } + /// KeyPolicy assigned to the storage account. + public partial interface IKeyPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + int KeyExpirationPeriodInDay { get; set; } + + } + /// KeyPolicy assigned to the storage account. + internal partial interface IKeyPolicyInternal + + { + /// The key expiration period in days. + int KeyExpirationPeriodInDay { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.json.cs new file mode 100644 index 000000000000..6270391c1b90 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyPolicy.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// KeyPolicy assigned to the storage account. + public partial class KeyPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new KeyPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal KeyPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyExpirationPeriodInDay = If( json?.PropertyT("keyExpirationPeriodInDays"), out var __jsonKeyExpirationPeriodInDays) ? (int)__jsonKeyExpirationPeriodInDays : KeyExpirationPeriodInDay;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber(this._keyExpirationPeriodInDay), "keyExpirationPeriodInDays" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.PowerShell.cs new file mode 100644 index 000000000000..eee95e471faa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of key vault. + [System.ComponentModel.TypeConverter(typeof(KeyVaultPropertiesTypeConverter))] + public partial class KeyVaultProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new KeyVaultProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new KeyVaultProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal KeyVaultProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVaultUri = (string) content.GetValueForProperty("KeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentVersionedKeyExpirationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("CurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyExpirationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal KeyVaultProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("KeyVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVersion = (string) content.GetValueForProperty("KeyVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVersion, global::System.Convert.ToString); + } + if (content.Contains("KeyVaultUri")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVaultUri = (string) content.GetValueForProperty("KeyVaultUri",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).KeyVaultUri, global::System.Convert.ToString); + } + if (content.Contains("CurrentVersionedKeyIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier = (string) content.GetValueForProperty("CurrentVersionedKeyIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyIdentifier, global::System.Convert.ToString); + } + if (content.Contains("LastKeyRotationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp = (global::System.DateTime?) content.GetValueForProperty("LastKeyRotationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).LastKeyRotationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("CurrentVersionedKeyExpirationTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyExpirationTimestamp = (global::System.DateTime?) content.GetValueForProperty("CurrentVersionedKeyExpirationTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal)this).CurrentVersionedKeyExpirationTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of key vault. + [System.ComponentModel.TypeConverter(typeof(KeyVaultPropertiesTypeConverter))] + public partial interface IKeyVaultProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.TypeConverter.cs new file mode 100644 index 000000000000..1ad3ae1163c4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class KeyVaultPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return KeyVaultProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return KeyVaultProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return KeyVaultProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.cs new file mode 100644 index 000000000000..8275321cd0f9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of key vault. + public partial class KeyVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal + { + + /// + /// Backing field for property. + /// + private global::System.DateTime? _currentVersionedKeyExpirationTimestamp; + + /// + /// This is a read only property that represents the expiration time of the current version of the customer managed key used + /// for encryption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? CurrentVersionedKeyExpirationTimestamp { get => this._currentVersionedKeyExpirationTimestamp; } + + /// Backing field for property. + private string _currentVersionedKeyIdentifier; + + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string CurrentVersionedKeyIdentifier { get => this._currentVersionedKeyIdentifier; } + + /// Backing field for property. + private string _keyName; + + /// The name of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyName { get => this._keyName; set => this._keyName = value; } + + /// Backing field for property. + private string _keyVaultUri; + + /// The Uri of KeyVault. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyVaultUri { get => this._keyVaultUri; set => this._keyVaultUri = value; } + + /// Backing field for property. + private string _keyVersion; + + /// The version of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyVersion { get => this._keyVersion; set => this._keyVersion = value; } + + /// Backing field for property. + private global::System.DateTime? _lastKeyRotationTimestamp; + + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastKeyRotationTimestamp { get => this._lastKeyRotationTimestamp; } + + /// Internal Acessors for CurrentVersionedKeyExpirationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal.CurrentVersionedKeyExpirationTimestamp { get => this._currentVersionedKeyExpirationTimestamp; set { {_currentVersionedKeyExpirationTimestamp = value;} } } + + /// Internal Acessors for CurrentVersionedKeyIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal.CurrentVersionedKeyIdentifier { get => this._currentVersionedKeyIdentifier; set { {_currentVersionedKeyIdentifier = value;} } } + + /// Internal Acessors for LastKeyRotationTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultPropertiesInternal.LastKeyRotationTimestamp { get => this._lastKeyRotationTimestamp; set { {_lastKeyRotationTimestamp = value;} } } + + /// Creates an new instance. + public KeyVaultProperties() + { + + } + } + /// Properties of key vault. + public partial interface IKeyVaultProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This is a read only property that represents the expiration time of the current version of the customer managed key used + /// for encryption. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This is a read only property that represents the expiration time of the current version of the customer managed key used for encryption.", + SerializedName = @"currentVersionedKeyExpirationTimestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CurrentVersionedKeyExpirationTimestamp { get; } + /// The object identifier of the current versioned Key Vault Key in use. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The object identifier of the current versioned Key Vault Key in use.", + SerializedName = @"currentVersionedKeyIdentifier", + PossibleTypes = new [] { typeof(string) })] + string CurrentVersionedKeyIdentifier { get; } + /// The name of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of KeyVault key.", + SerializedName = @"keyname", + PossibleTypes = new [] { typeof(string) })] + string KeyName { get; set; } + /// The Uri of KeyVault. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Uri of KeyVault.", + SerializedName = @"keyvaulturi", + PossibleTypes = new [] { typeof(string) })] + string KeyVaultUri { get; set; } + /// The version of KeyVault key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The version of KeyVault key.", + SerializedName = @"keyversion", + PossibleTypes = new [] { typeof(string) })] + string KeyVersion { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Timestamp of last rotation of the Key Vault Key.", + SerializedName = @"lastKeyRotationTimestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastKeyRotationTimestamp { get; } + + } + /// Properties of key vault. + internal partial interface IKeyVaultPropertiesInternal + + { + /// + /// This is a read only property that represents the expiration time of the current version of the customer managed key used + /// for encryption. + /// + global::System.DateTime? CurrentVersionedKeyExpirationTimestamp { get; set; } + /// The object identifier of the current versioned Key Vault Key in use. + string CurrentVersionedKeyIdentifier { get; set; } + /// The name of KeyVault key. + string KeyName { get; set; } + /// The Uri of KeyVault. + string KeyVaultUri { get; set; } + /// The version of KeyVault key. + string KeyVersion { get; set; } + /// Timestamp of last rotation of the Key Vault Key. + global::System.DateTime? LastKeyRotationTimestamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.json.cs new file mode 100644 index 000000000000..a50dd51da714 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/KeyVaultProperties.json.cs @@ -0,0 +1,127 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of key vault. + public partial class KeyVaultProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyVaultProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new KeyVaultProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal KeyVaultProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyName = If( json?.PropertyT("keyname"), out var __jsonKeyname) ? (string)__jsonKeyname : (string)KeyName;} + {_keyVersion = If( json?.PropertyT("keyversion"), out var __jsonKeyversion) ? (string)__jsonKeyversion : (string)KeyVersion;} + {_keyVaultUri = If( json?.PropertyT("keyvaulturi"), out var __jsonKeyvaulturi) ? (string)__jsonKeyvaulturi : (string)KeyVaultUri;} + {_currentVersionedKeyIdentifier = If( json?.PropertyT("currentVersionedKeyIdentifier"), out var __jsonCurrentVersionedKeyIdentifier) ? (string)__jsonCurrentVersionedKeyIdentifier : (string)CurrentVersionedKeyIdentifier;} + {_lastKeyRotationTimestamp = If( json?.PropertyT("lastKeyRotationTimestamp"), out var __jsonLastKeyRotationTimestamp) ? global::System.DateTime.TryParse((string)__jsonLastKeyRotationTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastKeyRotationTimestampValue) ? __jsonLastKeyRotationTimestampValue : LastKeyRotationTimestamp : LastKeyRotationTimestamp;} + {_currentVersionedKeyExpirationTimestamp = If( json?.PropertyT("currentVersionedKeyExpirationTimestamp"), out var __jsonCurrentVersionedKeyExpirationTimestamp) ? global::System.DateTime.TryParse((string)__jsonCurrentVersionedKeyExpirationTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCurrentVersionedKeyExpirationTimestampValue) ? __jsonCurrentVersionedKeyExpirationTimestampValue : CurrentVersionedKeyExpirationTimestamp : CurrentVersionedKeyExpirationTimestamp;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyname" ,container.Add ); + AddIf( null != (((object)this._keyVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyVersion.ToString()) : null, "keyversion" ,container.Add ); + AddIf( null != (((object)this._keyVaultUri)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyVaultUri.ToString()) : null, "keyvaulturi" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._currentVersionedKeyIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._currentVersionedKeyIdentifier.ToString()) : null, "currentVersionedKeyIdentifier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastKeyRotationTimestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastKeyRotationTimestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastKeyRotationTimestamp" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._currentVersionedKeyExpirationTimestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._currentVersionedKeyExpirationTimestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "currentVersionedKeyExpirationTimestamp" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.PowerShell.cs new file mode 100644 index 000000000000..7772857f688b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.PowerShell.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The blob service properties for Last access time based tracking policy. + [System.ComponentModel.TypeConverter(typeof(LastAccessTimeTrackingPolicyTypeConverter))] + public partial class LastAccessTimeTrackingPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LastAccessTimeTrackingPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LastAccessTimeTrackingPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LastAccessTimeTrackingPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Enable = (bool) content.GetValueForProperty("Enable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Enable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("TrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay = (int?) content.GetValueForProperty("TrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LastAccessTimeTrackingPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Enable = (bool) content.GetValueForProperty("Enable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Enable, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name?) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name.CreateFrom); + } + if (content.Contains("TrackingGranularityInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay = (int?) content.GetValueForProperty("TrackingGranularityInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).TrackingGranularityInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The blob service properties for Last access time based tracking policy. + [System.ComponentModel.TypeConverter(typeof(LastAccessTimeTrackingPolicyTypeConverter))] + public partial interface ILastAccessTimeTrackingPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.TypeConverter.cs new file mode 100644 index 000000000000..30b58df32b3a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LastAccessTimeTrackingPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LastAccessTimeTrackingPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LastAccessTimeTrackingPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LastAccessTimeTrackingPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.cs new file mode 100644 index 000000000000..9a9c182fbd23 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob service properties for Last access time based tracking policy. + public partial class LastAccessTimeTrackingPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicyInternal + { + + /// Backing field for property. + private string[] _blobType; + + /// + /// An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] BlobType { get => this._blobType; set => this._blobType = value; } + + /// Backing field for property. + private bool _enable; + + /// When set to true last access time based tracking is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool Enable { get => this._enable; set => this._enable = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name? _name; + + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name? Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private int? _trackingGranularityInDay; + + /// + /// The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This + /// field is currently read only with value as 1 + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? TrackingGranularityInDay { get => this._trackingGranularityInDay; set => this._trackingGranularityInDay = value; } + + /// Creates an new instance. + public LastAccessTimeTrackingPolicy() + { + + } + } + /// The blob service properties for Last access time based tracking policy. + public partial interface ILastAccessTimeTrackingPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only", + SerializedName = @"blobType", + PossibleTypes = new [] { typeof(string) })] + string[] BlobType { get; set; } + /// When set to true last access time based tracking is enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"When set to true last access time based tracking is enabled.", + SerializedName = @"enable", + PossibleTypes = new [] { typeof(bool) })] + bool Enable { get; set; } + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the policy. The valid value is AccessTimeTracking. This field is currently read only", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name? Name { get; set; } + /// + /// The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This + /// field is currently read only with value as 1 + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This field is currently read only with value as 1", + SerializedName = @"trackingGranularityInDays", + PossibleTypes = new [] { typeof(int) })] + int? TrackingGranularityInDay { get; set; } + + } + /// The blob service properties for Last access time based tracking policy. + internal partial interface ILastAccessTimeTrackingPolicyInternal + + { + /// + /// An array of predefined supported blob types. Only blockBlob is the supported value. This field is currently read only + /// + string[] BlobType { get; set; } + /// When set to true last access time based tracking is enabled. + bool Enable { get; set; } + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name? Name { get; set; } + /// + /// The field specifies blob object tracking granularity in days, typically how often the blob object should be tracked.This + /// field is currently read only with value as 1 + /// + int? TrackingGranularityInDay { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.json.cs new file mode 100644 index 000000000000..afaf6960ec80 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LastAccessTimeTrackingPolicy.json.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob service properties for Last access time based tracking policy. + public partial class LastAccessTimeTrackingPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILastAccessTimeTrackingPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LastAccessTimeTrackingPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LastAccessTimeTrackingPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enable = If( json?.PropertyT("enable"), out var __jsonEnable) ? (bool)__jsonEnable : Enable;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_trackingGranularityInDay = If( json?.PropertyT("trackingGranularityInDays"), out var __jsonTrackingGranularityInDays) ? (int?)__jsonTrackingGranularityInDays : TrackingGranularityInDay;} + {_blobType = If( json?.PropertyT("blobType"), out var __jsonBlobType) ? If( __jsonBlobType as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : BlobType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean(this._enable), "enable" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != this._trackingGranularityInDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._trackingGranularityInDay) : null, "trackingGranularityInDays" ,container.Add ); + if (null != this._blobType) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._blobType ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("blobType",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.PowerShell.cs new file mode 100644 index 000000000000..4c5fe2a98bf7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Lease Container request schema. + [System.ComponentModel.TypeConverter(typeof(LeaseContainerRequest1TypeConverter))] + public partial class LeaseContainerRequest1 + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LeaseContainerRequest1(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LeaseContainerRequest1(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LeaseContainerRequest1(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).ProposedLeaseId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LeaseContainerRequest1(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal)this).ProposedLeaseId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Lease Container request schema. + [System.ComponentModel.TypeConverter(typeof(LeaseContainerRequest1TypeConverter))] + public partial interface ILeaseContainerRequest1 + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.TypeConverter.cs new file mode 100644 index 000000000000..935edbdc5e0c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LeaseContainerRequest1TypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LeaseContainerRequest1.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LeaseContainerRequest1.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LeaseContainerRequest1.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.cs new file mode 100644 index 000000000000..40c545f83d33 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Container request schema. + public partial class LeaseContainerRequest1 : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1Internal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest _action; + + /// Specifies the lease action. Can be one of the available actions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Action { get => this._action; set => this._action = value; } + + /// Backing field for property. + private int? _breakPeriod; + + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? BreakPeriod { get => this._breakPeriod; set => this._breakPeriod = value; } + + /// Backing field for property. + private int? _leaseDuration; + + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? LeaseDuration { get => this._leaseDuration; set => this._leaseDuration = value; } + + /// Backing field for property. + private string _leaseId; + + /// Identifies the lease. Can be specified in any valid GUID string format. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LeaseId { get => this._leaseId; set => this._leaseId = value; } + + /// Backing field for property. + private string _proposedLeaseId; + + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ProposedLeaseId { get => this._proposedLeaseId; set => this._proposedLeaseId = value; } + + /// Creates an new instance. + public LeaseContainerRequest1() + { + + } + } + /// Lease Container request schema. + public partial interface ILeaseContainerRequest1 : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Specifies the lease action. Can be one of the available actions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the lease action. Can be one of the available actions.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Action { get; set; } + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.", + SerializedName = @"breakPeriod", + PossibleTypes = new [] { typeof(int) })] + int? BreakPeriod { get; set; } + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(int) })] + int? LeaseDuration { get; set; } + /// Identifies the lease. Can be specified in any valid GUID string format. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the lease. Can be specified in any valid GUID string format.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + string LeaseId { get; set; } + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional for acquire, required for change. Proposed lease ID, in a GUID string format.", + SerializedName = @"proposedLeaseId", + PossibleTypes = new [] { typeof(string) })] + string ProposedLeaseId { get; set; } + + } + /// Lease Container request schema. + internal partial interface ILeaseContainerRequest1Internal + + { + /// Specifies the lease action. Can be one of the available actions. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Action { get; set; } + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + int? BreakPeriod { get; set; } + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + int? LeaseDuration { get; set; } + /// Identifies the lease. Can be specified in any valid GUID string format. + string LeaseId { get; set; } + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + string ProposedLeaseId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.json.cs new file mode 100644 index 000000000000..2797e8e60c96 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerRequest1.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Container request schema. + public partial class LeaseContainerRequest1 + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LeaseContainerRequest1(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LeaseContainerRequest1(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + {_leaseId = If( json?.PropertyT("leaseId"), out var __jsonLeaseId) ? (string)__jsonLeaseId : (string)LeaseId;} + {_breakPeriod = If( json?.PropertyT("breakPeriod"), out var __jsonBreakPeriod) ? (int?)__jsonBreakPeriod : BreakPeriod;} + {_leaseDuration = If( json?.PropertyT("leaseDuration"), out var __jsonLeaseDuration) ? (int?)__jsonLeaseDuration : LeaseDuration;} + {_proposedLeaseId = If( json?.PropertyT("proposedLeaseId"), out var __jsonProposedLeaseId) ? (string)__jsonProposedLeaseId : (string)ProposedLeaseId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._action)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._action.ToString()) : null, "action" ,container.Add ); + AddIf( null != (((object)this._leaseId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseId.ToString()) : null, "leaseId" ,container.Add ); + AddIf( null != this._breakPeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._breakPeriod) : null, "breakPeriod" ,container.Add ); + AddIf( null != this._leaseDuration ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._leaseDuration) : null, "leaseDuration" ,container.Add ); + AddIf( null != (((object)this._proposedLeaseId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._proposedLeaseId.ToString()) : null, "proposedLeaseId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.PowerShell.cs new file mode 100644 index 000000000000..ecf1da33a489 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Lease Container response schema. + [System.ComponentModel.TypeConverter(typeof(LeaseContainerResponseTypeConverter))] + public partial class LeaseContainerResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LeaseContainerResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LeaseContainerResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LeaseContainerResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseTimeSecond, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LeaseContainerResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal)this).LeaseTimeSecond, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Lease Container response schema. + [System.ComponentModel.TypeConverter(typeof(LeaseContainerResponseTypeConverter))] + public partial interface ILeaseContainerResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.TypeConverter.cs new file mode 100644 index 000000000000..91b82d0e30f3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LeaseContainerResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LeaseContainerResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LeaseContainerResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LeaseContainerResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.cs new file mode 100644 index 000000000000..b11b4fb61da7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Container response schema. + public partial class LeaseContainerResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponseInternal + { + + /// Backing field for property. + private string _leaseId; + + /// + /// Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release + /// the lease. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LeaseId { get => this._leaseId; set => this._leaseId = value; } + + /// Backing field for property. + private string _leaseTimeSecond; + + /// Approximate time remaining in the lease period, in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LeaseTimeSecond { get => this._leaseTimeSecond; set => this._leaseTimeSecond = value; } + + /// Creates an new instance. + public LeaseContainerResponse() + { + + } + } + /// Lease Container response schema. + public partial interface ILeaseContainerResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release + /// the lease. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release the lease.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + string LeaseId { get; set; } + /// Approximate time remaining in the lease period, in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Approximate time remaining in the lease period, in seconds.", + SerializedName = @"leaseTimeSeconds", + PossibleTypes = new [] { typeof(string) })] + string LeaseTimeSecond { get; set; } + + } + /// Lease Container response schema. + internal partial interface ILeaseContainerResponseInternal + + { + /// + /// Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or release + /// the lease. + /// + string LeaseId { get; set; } + /// Approximate time remaining in the lease period, in seconds. + string LeaseTimeSecond { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.json.cs new file mode 100644 index 000000000000..0a2802898701 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseContainerResponse.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Container response schema. + public partial class LeaseContainerResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LeaseContainerResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LeaseContainerResponse(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_leaseId = If( json?.PropertyT("leaseId"), out var __jsonLeaseId) ? (string)__jsonLeaseId : (string)LeaseId;} + {_leaseTimeSecond = If( json?.PropertyT("leaseTimeSeconds"), out var __jsonLeaseTimeSeconds) ? (string)__jsonLeaseTimeSeconds : (string)LeaseTimeSecond;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._leaseId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseId.ToString()) : null, "leaseId" ,container.Add ); + AddIf( null != (((object)this._leaseTimeSecond)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseTimeSecond.ToString()) : null, "leaseTimeSeconds" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.PowerShell.cs new file mode 100644 index 000000000000..18219ff592f4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Lease Share request schema. + [System.ComponentModel.TypeConverter(typeof(LeaseShareRequestTypeConverter))] + public partial class LeaseShareRequest + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LeaseShareRequest(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LeaseShareRequest(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LeaseShareRequest(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).ProposedLeaseId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LeaseShareRequest(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction.CreateFrom); + } + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("BreakPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).BreakPeriod = (int?) content.GetValueForProperty("BreakPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).BreakPeriod, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseDuration = (int?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).LeaseDuration, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ProposedLeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).ProposedLeaseId = (string) content.GetValueForProperty("ProposedLeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal)this).ProposedLeaseId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Lease Share request schema. + [System.ComponentModel.TypeConverter(typeof(LeaseShareRequestTypeConverter))] + public partial interface ILeaseShareRequest + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.TypeConverter.cs new file mode 100644 index 000000000000..3f4869e38f43 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LeaseShareRequestTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LeaseShareRequest.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LeaseShareRequest.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LeaseShareRequest.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.cs new file mode 100644 index 000000000000..9e875d0ad861 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Share request schema. + public partial class LeaseShareRequest : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequestInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction _action; + + /// Specifies the lease action. Can be one of the available actions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Action { get => this._action; set => this._action = value; } + + /// Backing field for property. + private int? _breakPeriod; + + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? BreakPeriod { get => this._breakPeriod; set => this._breakPeriod = value; } + + /// Backing field for property. + private int? _leaseDuration; + + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? LeaseDuration { get => this._leaseDuration; set => this._leaseDuration = value; } + + /// Backing field for property. + private string _leaseId; + + /// Identifies the lease. Can be specified in any valid GUID string format. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LeaseId { get => this._leaseId; set => this._leaseId = value; } + + /// Backing field for property. + private string _proposedLeaseId; + + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ProposedLeaseId { get => this._proposedLeaseId; set => this._proposedLeaseId = value; } + + /// Creates an new instance. + public LeaseShareRequest() + { + + } + } + /// Lease Share request schema. + public partial interface ILeaseShareRequest : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Specifies the lease action. Can be one of the available actions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the lease action. Can be one of the available actions.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Action { get; set; } + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.", + SerializedName = @"breakPeriod", + PossibleTypes = new [] { typeof(int) })] + int? BreakPeriod { get; set; } + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(int) })] + int? LeaseDuration { get; set; } + /// Identifies the lease. Can be specified in any valid GUID string format. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the lease. Can be specified in any valid GUID string format.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + string LeaseId { get; set; } + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional for acquire, required for change. Proposed lease ID, in a GUID string format.", + SerializedName = @"proposedLeaseId", + PossibleTypes = new [] { typeof(string) })] + string ProposedLeaseId { get; set; } + + } + /// Lease Share request schema. + internal partial interface ILeaseShareRequestInternal + + { + /// Specifies the lease action. Can be one of the available actions. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Action { get; set; } + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + int? BreakPeriod { get; set; } + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + int? LeaseDuration { get; set; } + /// Identifies the lease. Can be specified in any valid GUID string format. + string LeaseId { get; set; } + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + string ProposedLeaseId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.json.cs new file mode 100644 index 000000000000..a5d0d7463e09 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareRequest.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Share request schema. + public partial class LeaseShareRequest + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LeaseShareRequest(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LeaseShareRequest(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + {_leaseId = If( json?.PropertyT("leaseId"), out var __jsonLeaseId) ? (string)__jsonLeaseId : (string)LeaseId;} + {_breakPeriod = If( json?.PropertyT("breakPeriod"), out var __jsonBreakPeriod) ? (int?)__jsonBreakPeriod : BreakPeriod;} + {_leaseDuration = If( json?.PropertyT("leaseDuration"), out var __jsonLeaseDuration) ? (int?)__jsonLeaseDuration : LeaseDuration;} + {_proposedLeaseId = If( json?.PropertyT("proposedLeaseId"), out var __jsonProposedLeaseId) ? (string)__jsonProposedLeaseId : (string)ProposedLeaseId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._action)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._action.ToString()) : null, "action" ,container.Add ); + AddIf( null != (((object)this._leaseId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseId.ToString()) : null, "leaseId" ,container.Add ); + AddIf( null != this._breakPeriod ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._breakPeriod) : null, "breakPeriod" ,container.Add ); + AddIf( null != this._leaseDuration ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._leaseDuration) : null, "leaseDuration" ,container.Add ); + AddIf( null != (((object)this._proposedLeaseId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._proposedLeaseId.ToString()) : null, "proposedLeaseId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.PowerShell.cs new file mode 100644 index 000000000000..2a625390cf7b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Lease Share response schema. + [System.ComponentModel.TypeConverter(typeof(LeaseShareResponseTypeConverter))] + public partial class LeaseShareResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LeaseShareResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LeaseShareResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LeaseShareResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseTimeSecond, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).ETag, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LeaseShareResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("LeaseId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseId = (string) content.GetValueForProperty("LeaseId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseId, global::System.Convert.ToString); + } + if (content.Contains("LeaseTimeSecond")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseTimeSecond = (string) content.GetValueForProperty("LeaseTimeSecond",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).LeaseTimeSecond, global::System.Convert.ToString); + } + if (content.Contains("ETag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).ETag = (string) content.GetValueForProperty("ETag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).ETag, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Lease Share response schema. + [System.ComponentModel.TypeConverter(typeof(LeaseShareResponseTypeConverter))] + public partial interface ILeaseShareResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.TypeConverter.cs new file mode 100644 index 000000000000..83446ec4d399 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LeaseShareResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LeaseShareResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LeaseShareResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LeaseShareResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.cs new file mode 100644 index 000000000000..1a88fc7261a3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Share response schema. + public partial class LeaseShareResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable + { + + /// Backing field for property. + private string _eTag; + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ETag { get => this._eTag; set => this._eTag = value; } + + /// Backing field for property. + private string _leaseId; + + /// + /// Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or release the + /// lease. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LeaseId { get => this._leaseId; set => this._leaseId = value; } + + /// Backing field for property. + private string _leaseTimeSecond; + + /// Approximate time remaining in the lease period, in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LeaseTimeSecond { get => this._leaseTimeSecond; set => this._leaseTimeSecond = value; } + + /// Creates an new instance. + public LeaseShareResponse() + { + + } + + /// + void Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IHeaderSerializable.ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers) + { + if (headers.TryGetValues("ETag", out var __eTagHeader0)) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponseInternal)this).ETag = System.Linq.Enumerable.FirstOrDefault(__eTagHeader0) is string __headerETagHeader0 ? __headerETagHeader0 : (string)null; + } + } + } + /// Lease Share response schema. + public partial interface ILeaseShareResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"ETag", + PossibleTypes = new [] { typeof(string) })] + string ETag { get; set; } + /// + /// Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or release the + /// lease. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or release the lease.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + string LeaseId { get; set; } + /// Approximate time remaining in the lease period, in seconds. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Approximate time remaining in the lease period, in seconds.", + SerializedName = @"leaseTimeSeconds", + PossibleTypes = new [] { typeof(string) })] + string LeaseTimeSecond { get; set; } + + } + /// Lease Share response schema. + internal partial interface ILeaseShareResponseInternal + + { + string ETag { get; set; } + /// + /// Returned unique lease ID that must be included with any request to delete the share, or to renew, change, or release the + /// lease. + /// + string LeaseId { get; set; } + /// Approximate time remaining in the lease period, in seconds. + string LeaseTimeSecond { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.json.cs new file mode 100644 index 000000000000..90422ce037ff --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LeaseShareResponse.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Lease Share response schema. + public partial class LeaseShareResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LeaseShareResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LeaseShareResponse(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_leaseId = If( json?.PropertyT("leaseId"), out var __jsonLeaseId) ? (string)__jsonLeaseId : (string)LeaseId;} + {_leaseTimeSecond = If( json?.PropertyT("leaseTimeSeconds"), out var __jsonLeaseTimeSeconds) ? (string)__jsonLeaseTimeSeconds : (string)LeaseTimeSecond;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._leaseId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseId.ToString()) : null, "leaseId" ,container.Add ); + AddIf( null != (((object)this._leaseTimeSecond)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._leaseTimeSecond.ToString()) : null, "leaseTimeSeconds" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.PowerShell.cs new file mode 100644 index 000000000000..0f818c71541a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The LegalHold property of a blob container. + [System.ComponentModel.TypeConverter(typeof(LegalHoldTypeConverter))] + public partial class LegalHold + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegalHold(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegalHold(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegalHold(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LegalHold(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).Tag = (string[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The LegalHold property of a blob container. + [System.ComponentModel.TypeConverter(typeof(LegalHoldTypeConverter))] + public partial interface ILegalHold + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.TypeConverter.cs new file mode 100644 index 000000000000..18ea548218a3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegalHoldTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegalHold.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegalHold.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegalHold.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.cs new file mode 100644 index 000000000000..3a495bbf1a80 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The LegalHold property of a blob container. + public partial class LegalHold : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal + { + + /// Backing field for property. + private bool? _allowProtectedAppendWritesAll; + + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowProtectedAppendWritesAll { get => this._allowProtectedAppendWritesAll; set => this._allowProtectedAppendWritesAll = value; } + + /// Backing field for property. + private bool? _hasLegalHold; + + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? HasLegalHold { get => this._hasLegalHold; } + + /// Internal Acessors for HasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldInternal.HasLegalHold { get => this._hasLegalHold; set { {_hasLegalHold = value;} } } + + /// Backing field for property. + private string[] _tag; + + /// + /// Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] Tag { get => this._tag; set => this._tag = value; } + + /// Creates an new instance. + public LegalHold() + { + + } + } + /// The LegalHold property of a blob container. + public partial interface ILegalHold : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.", + SerializedName = @"hasLegalHold", + PossibleTypes = new [] { typeof(bool) })] + bool? HasLegalHold { get; } + /// + /// Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + string[] Tag { get; set; } + + } + /// The LegalHold property of a blob container. + internal partial interface ILegalHoldInternal + + { + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + bool? HasLegalHold { get; set; } + /// + /// Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + /// + string[] Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.json.cs new file mode 100644 index 000000000000..b7a5cbbbbf76 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHold.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The LegalHold property of a blob container. + public partial class LegalHold + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LegalHold(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LegalHold(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_hasLegalHold = If( json?.PropertyT("hasLegalHold"), out var __jsonHasLegalHold) ? (bool?)__jsonHasLegalHold : HasLegalHold;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Tag;} + {_allowProtectedAppendWritesAll = If( json?.PropertyT("allowProtectedAppendWritesAll"), out var __jsonAllowProtectedAppendWritesAll) ? (bool?)__jsonAllowProtectedAppendWritesAll : AllowProtectedAppendWritesAll;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._hasLegalHold ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._hasLegalHold) : null, "hasLegalHold" ,container.Add ); + } + if (null != this._tag) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._tag ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("tags",__w); + } + AddIf( null != this._allowProtectedAppendWritesAll ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowProtectedAppendWritesAll) : null, "allowProtectedAppendWritesAll" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.PowerShell.cs new file mode 100644 index 000000000000..d5ad873acf40 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The LegalHold property of a blob container. + [System.ComponentModel.TypeConverter(typeof(LegalHoldPropertiesTypeConverter))] + public partial class LegalHoldProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LegalHoldProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LegalHoldProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LegalHoldProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory) content.GetValueForProperty("ProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LegalHoldProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory) content.GetValueForProperty("ProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[]) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).Tag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The LegalHold property of a blob container. + [System.ComponentModel.TypeConverter(typeof(LegalHoldPropertiesTypeConverter))] + public partial interface ILegalHoldProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.TypeConverter.cs new file mode 100644 index 000000000000..d0bf7d29c874 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LegalHoldPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LegalHoldProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LegalHoldProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LegalHoldProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.cs new file mode 100644 index 000000000000..57fc46136490 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The LegalHold property of a blob container. + public partial class LegalHoldProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal + { + + /// Backing field for property. + private bool? _hasLegalHold; + + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? HasLegalHold { get => this._hasLegalHold; } + + /// Internal Acessors for HasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal.HasLegalHold { get => this._hasLegalHold; set { {_hasLegalHold = value;} } } + + /// Internal Acessors for ProtectedAppendWriteHistoryTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal.ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).Timestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).Timestamp = value; } + + /// Internal Acessors for ProtectedAppendWritesHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldPropertiesInternal.ProtectedAppendWritesHistory { get => (this._protectedAppendWritesHistory = this._protectedAppendWritesHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistory()); set { {_protectedAppendWritesHistory = value;} } } + + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).AllowProtectedAppendWritesAll = value ?? default(bool); } + + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)ProtectedAppendWritesHistory).Timestamp; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory _protectedAppendWritesHistory; + + /// Protected append blob writes history. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory ProtectedAppendWritesHistory { get => (this._protectedAppendWritesHistory = this._protectedAppendWritesHistory ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistory()); set => this._protectedAppendWritesHistory = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] _tag; + + /// The list of LegalHold tags of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] Tag { get => this._tag; set => this._tag = value; } + + /// Creates an new instance. + public LegalHoldProperties() + { + + } + } + /// The LegalHold property of a blob container. + public partial interface ILegalHoldProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.", + SerializedName = @"hasLegalHold", + PossibleTypes = new [] { typeof(bool) })] + bool? HasLegalHold { get; } + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the tag was added.", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get; } + /// The list of LegalHold tags of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of LegalHold tags of a blob container.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] Tag { get; set; } + + } + /// The LegalHold property of a blob container. + internal partial interface ILegalHoldPropertiesInternal + + { + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + bool? HasLegalHold { get; set; } + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get; set; } + /// Protected append blob writes history. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory ProtectedAppendWritesHistory { get; set; } + /// The list of LegalHold tags of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.json.cs new file mode 100644 index 000000000000..63a040541027 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LegalHoldProperties.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The LegalHold property of a blob container. + public partial class LegalHoldProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LegalHoldProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LegalHoldProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_protectedAppendWritesHistory = If( json?.PropertyT("protectedAppendWritesHistory"), out var __jsonProtectedAppendWritesHistory) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistory.FromJson(__jsonProtectedAppendWritesHistory) : ProtectedAppendWritesHistory;} + {_hasLegalHold = If( json?.PropertyT("hasLegalHold"), out var __jsonHasLegalHold) ? (bool?)__jsonHasLegalHold : HasLegalHold;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? If( __jsonTags as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagProperty.FromJson(__u) )) ))() : null : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._protectedAppendWritesHistory ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._protectedAppendWritesHistory.ToJson(null,serializationMode) : null, "protectedAppendWritesHistory" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._hasLegalHold ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._hasLegalHold) : null, "hasLegalHold" ,container.Add ); + } + if (null != this._tag) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._tag ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("tags",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.PowerShell.cs new file mode 100644 index 000000000000..20dd180d05c9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The List SAS credentials operation response. + [System.ComponentModel.TypeConverter(typeof(ListAccountSasResponseTypeConverter))] + public partial class ListAccountSasResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListAccountSasResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListAccountSasResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListAccountSasResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccountSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponseInternal)this).AccountSasToken = (string) content.GetValueForProperty("AccountSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponseInternal)this).AccountSasToken, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListAccountSasResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccountSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponseInternal)this).AccountSasToken = (string) content.GetValueForProperty("AccountSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponseInternal)this).AccountSasToken, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The List SAS credentials operation response. + [System.ComponentModel.TypeConverter(typeof(ListAccountSasResponseTypeConverter))] + public partial interface IListAccountSasResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.TypeConverter.cs new file mode 100644 index 000000000000..829bb1428897 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListAccountSasResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListAccountSasResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListAccountSasResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListAccountSasResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.cs new file mode 100644 index 000000000000..4dd82aee4aba --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The List SAS credentials operation response. + public partial class ListAccountSasResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponseInternal + { + + /// Backing field for property. + private string _accountSasToken; + + /// List SAS credentials of storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string AccountSasToken { get => this._accountSasToken; } + + /// Internal Acessors for AccountSasToken + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponseInternal.AccountSasToken { get => this._accountSasToken; set { {_accountSasToken = value;} } } + + /// Creates an new instance. + public ListAccountSasResponse() + { + + } + } + /// The List SAS credentials operation response. + public partial interface IListAccountSasResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List SAS credentials of storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List SAS credentials of storage account.", + SerializedName = @"accountSasToken", + PossibleTypes = new [] { typeof(string) })] + string AccountSasToken { get; } + + } + /// The List SAS credentials operation response. + internal partial interface IListAccountSasResponseInternal + + { + /// List SAS credentials of storage account. + string AccountSasToken { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.json.cs new file mode 100644 index 000000000000..b513806da839 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListAccountSasResponse.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The List SAS credentials operation response. + public partial class ListAccountSasResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListAccountSasResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListAccountSasResponse(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_accountSasToken = If( json?.PropertyT("accountSasToken"), out var __jsonAccountSasToken) ? (string)__jsonAccountSasToken : (string)AccountSasToken;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accountSasToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accountSasToken.ToString()) : null, "accountSasToken" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.PowerShell.cs new file mode 100644 index 000000000000..526c4b7a3356 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// List of blob inventory policies returned. + [System.ComponentModel.TypeConverter(typeof(ListBlobInventoryPolicyTypeConverter))] + public partial class ListBlobInventoryPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListBlobInventoryPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListBlobInventoryPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListBlobInventoryPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicyInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicyInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListBlobInventoryPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicyInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicyInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicyTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of blob inventory policies returned. + [System.ComponentModel.TypeConverter(typeof(ListBlobInventoryPolicyTypeConverter))] + public partial interface IListBlobInventoryPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.TypeConverter.cs new file mode 100644 index 000000000000..f9391ae347d4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListBlobInventoryPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListBlobInventoryPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListBlobInventoryPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListBlobInventoryPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.cs new file mode 100644 index 000000000000..beaebf5030db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List of blob inventory policies returned. + public partial class ListBlobInventoryPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicyInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicyInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy[] _value; + + /// List of blob inventory policies. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy[] Value { get => this._value; } + + /// Creates an new instance. + public ListBlobInventoryPolicy() + { + + } + } + /// List of blob inventory policies returned. + public partial interface IListBlobInventoryPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of blob inventory policies. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of blob inventory policies.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy[] Value { get; } + + } + /// List of blob inventory policies returned. + internal partial interface IListBlobInventoryPolicyInternal + + { + /// List of blob inventory policies. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.json.cs new file mode 100644 index 000000000000..cc32352d7307 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListBlobInventoryPolicy.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List of blob inventory policies returned. + public partial class ListBlobInventoryPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListBlobInventoryPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListBlobInventoryPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicy.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.PowerShell.cs new file mode 100644 index 000000000000..f420444c59b7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.PowerShell.cs @@ -0,0 +1,448 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The blob container properties be listed out. + [System.ComponentModel.TypeConverter(typeof(ListContainerItemTypeConverter))] + public partial class ListContainerItem + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListContainerItem(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListContainerItem(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListContainerItem(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("PublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListContainerItem(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Etag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag = (string) content.GetValueForProperty("Etag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)this).Etag, global::System.Convert.ToString); + } + if (content.Contains("PublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).PublicAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess?) content.GetValueForProperty("PublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).PublicAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess.CreateFrom); + } + if (content.Contains("LeaseStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus?) content.GetValueForProperty("LeaseStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus.CreateFrom); + } + if (content.Contains("LeaseState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState?) content.GetValueForProperty("LeaseState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState.CreateFrom); + } + if (content.Contains("LeaseDuration")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseDuration = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration?) content.GetValueForProperty("LeaseDuration",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LeaseDuration, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration.CreateFrom); + } + if (content.Contains("ImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties) content.GetValueForProperty("ImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHold = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties) content.GetValueForProperty("LegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHold, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHoldPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageWithVersioningTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("Deleted")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Deleted = (bool?) content.GetValueForProperty("Deleted",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Deleted, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DeletedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DeletedTime = (global::System.DateTime?) content.GetValueForProperty("DeletedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DeletedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("RemainingRetentionDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).RemainingRetentionDay = (int?) content.GetValueForProperty("RemainingRetentionDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).RemainingRetentionDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("DefaultEncryptionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DefaultEncryptionScope = (string) content.GetValueForProperty("DefaultEncryptionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DefaultEncryptionScope, global::System.Convert.ToString); + } + if (content.Contains("DenyEncryptionScopeOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DenyEncryptionScopeOverride = (bool?) content.GetValueForProperty("DenyEncryptionScopeOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).DenyEncryptionScopeOverride, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerPropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("HasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasLegalHold = (bool?) content.GetValueForProperty("HasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasImmutabilityPolicy = (bool?) content.GetValueForProperty("HasImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).HasImmutabilityPolicy, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3RootSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3RootSquash = (bool?) content.GetValueForProperty("EnableNfsV3RootSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3RootSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3AllSquash")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3AllSquash = (bool?) content.GetValueForProperty("EnableNfsV3AllSquash",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).EnableNfsV3AllSquash, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningTimeStamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningTimeStamp = (global::System.DateTime?) content.GetValueForProperty("ImmutableStorageWithVersioningTimeStamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningTimeStamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningMigrationState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState?) content.GetValueForProperty("ImmutableStorageWithVersioningMigrationState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningMigrationState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty) content.GetValueForProperty("ImmutabilityPolicyProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicyPropertyTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutabilityPolicyEtag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyEtag = (string) content.GetValueForProperty("ImmutabilityPolicyEtag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyEtag, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyUpdateHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[]) content.GetValueForProperty("ImmutabilityPolicyUpdateHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPolicyUpdateHistory, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UpdateHistoryPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("LegalHoldProtectedAppendWritesHistory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory) content.GetValueForProperty("LegalHoldProtectedAppendWritesHistory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldProtectedAppendWritesHistory, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ProtectedAppendWritesHistoryTypeConverter.ConvertFrom); + } + if (content.Contains("LegalHoldHasLegalHold")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldHasLegalHold = (bool?) content.GetValueForProperty("LegalHoldHasLegalHold",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldHasLegalHold, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LegalHoldTag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldTag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[]) content.GetValueForProperty("LegalHoldTag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).LegalHoldTag, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagPropertyTypeConverter.ConvertFrom)); + } + if (content.Contains("ProtectedAppendWriteHistoryTimestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryTimestamp = (global::System.DateTime?) content.GetValueForProperty("ProtectedAppendWriteHistoryTimestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryTimestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal)this).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The blob container properties be listed out. + [System.ComponentModel.TypeConverter(typeof(ListContainerItemTypeConverter))] + public partial interface IListContainerItem + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.TypeConverter.cs new file mode 100644 index 000000000000..71596c690a15 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListContainerItemTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListContainerItem.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListContainerItem.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListContainerItem.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.cs new file mode 100644 index 000000000000..5429af3608e0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.cs @@ -0,0 +1,687 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob container properties be listed out. + public partial class ListContainerItem : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(); + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).AllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).AllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowProtectedAppendWritesAll { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).AllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).AllowProtectedAppendWritesAll = value ?? default(bool); } + + /// Default the container to use specified encryption scope for all writes. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DefaultEncryptionScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).DefaultEncryptionScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).DefaultEncryptionScope = value ?? null; } + + /// Indicates whether the blob container was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? Deleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Deleted; } + + /// Blob container deletion time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? DeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).DeletedTime; } + + /// Block override of encryption scope from the container default. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? DenyEncryptionScopeOverride { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).DenyEncryptionScopeOverride; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).DenyEncryptionScopeOverride = value ?? default(bool); } + + /// Enable NFSv3 all squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableNfsV3AllSquash { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).EnableNfsV3AllSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).EnableNfsV3AllSquash = value ?? default(bool); } + + /// Enable NFSv3 root squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableNfsV3RootSquash { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).EnableNfsV3RootSquash; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).EnableNfsV3RootSquash = value ?? default(bool); } + + /// Resource Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; } + + /// + /// The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. + /// The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? HasImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).HasImmutabilityPolicy; } + + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? HasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).HasLegalHold; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// ImmutabilityPolicy Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ImmutabilityPolicyEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyEtag; } + + /// The ImmutabilityPolicy update history of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyUpdateHistory; } + + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningEnabled = value ?? default(bool); } + + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? ImmutableStorageWithVersioningMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningMigrationState; } + + /// Returns the date and time the object level immutability was enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ImmutableStorageWithVersioningTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningTimeStamp; } + + /// Returns the date and time the container was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LastModifiedTime; } + + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseDuration; } + + /// Lease state of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseState; } + + /// The lease status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseStatus; } + + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? LegalHoldHasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHoldHasLegalHold; } + + /// The list of LegalHold tags of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] LegalHoldTag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHoldTag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHoldTag = value ?? null /* arrayOf */; } + + /// A name-value pair to associate with the container as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata Metadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Metadata = value ?? null /* model class */; } + + /// Internal Acessors for Etag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal.Etag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal)__azureEntityResource).Etag = value; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type = value; } + + /// Internal Acessors for Deleted + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.Deleted { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Deleted; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Deleted = value; } + + /// Internal Acessors for DeletedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.DeletedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).DeletedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).DeletedTime = value; } + + /// Internal Acessors for HasImmutabilityPolicy + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.HasImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).HasImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).HasImmutabilityPolicy = value; } + + /// Internal Acessors for HasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.HasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).HasLegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).HasLegalHold = value; } + + /// Internal Acessors for ImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicy = value; } + + /// Internal Acessors for ImmutabilityPolicyEtag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ImmutabilityPolicyEtag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyEtag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyEtag = value; } + + /// Internal Acessors for ImmutabilityPolicyProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ImmutabilityPolicyProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyProperty = value; } + + /// Internal Acessors for ImmutabilityPolicyUpdateHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ImmutabilityPolicyUpdateHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyUpdateHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutabilityPolicyUpdateHistory = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningMigrationState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ImmutableStorageWithVersioningMigrationState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningMigrationState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningMigrationState = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningTimeStamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ImmutableStorageWithVersioningTimeStamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningTimeStamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ImmutableStorageWithVersioningTimeStamp = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for LeaseDuration + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.LeaseDuration { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseDuration; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseDuration = value; } + + /// Internal Acessors for LeaseState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.LeaseState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseState = value; } + + /// Internal Acessors for LeaseStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.LeaseStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LeaseStatus = value; } + + /// Internal Acessors for LegalHold + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.LegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHold = value; } + + /// Internal Acessors for LegalHoldHasLegalHold + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.LegalHoldHasLegalHold { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHoldHasLegalHold; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHoldHasLegalHold = value; } + + /// Internal Acessors for LegalHoldProtectedAppendWritesHistory + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.LegalHoldProtectedAppendWritesHistory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHoldProtectedAppendWritesHistory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).LegalHoldProtectedAppendWritesHistory = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProtectedAppendWriteHistoryTimestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryTimestamp; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryTimestamp = value; } + + /// Internal Acessors for RemainingRetentionDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.RemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).RemainingRetentionDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).RemainingRetentionDay = value; } + + /// Internal Acessors for State + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).State; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).State = value; } + + /// Internal Acessors for Version + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemInternal.Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Version = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties _property; + + /// The blob container properties be listed out. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerProperties()); set => this._property = value; } + + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll = value ?? default(bool); } + + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).ProtectedAppendWriteHistoryTimestamp; } + + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess? PublicAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).PublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).PublicAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess)""); } + + /// Remaining retention days for soft deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? RemainingRetentionDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).RemainingRetentionDay; } + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).State; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__azureEntityResource).Type; } + + /// The version of the deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Version { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesInternal)Property).Version; } + + /// Creates an new instance. + public ListContainerItem() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__azureEntityResource), __azureEntityResource); + await eventListener.AssertObjectIsValid(nameof(__azureEntityResource), __azureEntityResource); + } + } + /// The blob container properties be listed out. + public partial interface IListContainerItem : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResource + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + /// Default the container to use specified encryption scope for all writes. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default the container to use specified encryption scope for all writes.", + SerializedName = @"defaultEncryptionScope", + PossibleTypes = new [] { typeof(string) })] + string DefaultEncryptionScope { get; set; } + /// Indicates whether the blob container was deleted. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates whether the blob container was deleted.", + SerializedName = @"deleted", + PossibleTypes = new [] { typeof(bool) })] + bool? Deleted { get; } + /// Blob container deletion time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Blob container deletion time.", + SerializedName = @"deletedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? DeletedTime { get; } + /// Block override of encryption scope from the container default. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Block override of encryption scope from the container default.", + SerializedName = @"denyEncryptionScopeOverride", + PossibleTypes = new [] { typeof(bool) })] + bool? DenyEncryptionScopeOverride { get; set; } + /// Enable NFSv3 all squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable NFSv3 all squash on blob container.", + SerializedName = @"enableNfsV3AllSquash", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3AllSquash { get; set; } + /// Enable NFSv3 root squash on blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enable NFSv3 root squash on blob container.", + SerializedName = @"enableNfsV3RootSquash", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3RootSquash { get; set; } + /// + /// The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. + /// The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container.", + SerializedName = @"hasImmutabilityPolicy", + PossibleTypes = new [] { typeof(bool) })] + bool? HasImmutabilityPolicy { get; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.", + SerializedName = @"hasLegalHold", + PossibleTypes = new [] { typeof(bool) })] + bool? HasLegalHold { get; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// ImmutabilityPolicy Etag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"ImmutabilityPolicy Etag.", + SerializedName = @"etag", + PossibleTypes = new [] { typeof(string) })] + string ImmutabilityPolicyEtag { get; } + /// The ImmutabilityPolicy update history of the blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy update history of the blob container.", + SerializedName = @"updateHistory", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get; } + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This is an immutable property, when set to true it enables object level immutability at the container level.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property denotes the container level immutability to object level immutability migration state.", + SerializedName = @"migrationState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? ImmutableStorageWithVersioningMigrationState { get; } + /// Returns the date and time the object level immutability was enabled. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the object level immutability was enabled.", + SerializedName = @"timeStamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ImmutableStorageWithVersioningTimeStamp { get; } + /// Returns the date and time the container was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the container was last modified.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; } + /// Lease state of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Lease state of the container.", + SerializedName = @"leaseState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; } + /// The lease status of the container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The lease status of the container.", + SerializedName = @"leaseStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers with hasLegalHold=true for a given account.", + SerializedName = @"hasLegalHold", + PossibleTypes = new [] { typeof(bool) })] + bool? LegalHoldHasLegalHold { get; } + /// The list of LegalHold tags of a blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The list of LegalHold tags of a blob container.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] LegalHoldTag { get; set; } + /// A name-value pair to associate with the container as metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the container as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata Metadata { get; set; } + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the tag was added.", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get; } + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether data in the container may be accessed publicly and the level of access.", + SerializedName = @"publicAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess? PublicAccess { get; set; } + /// Remaining retention days for soft deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Remaining retention days for soft deleted blob container.", + SerializedName = @"remainingRetentionDays", + PossibleTypes = new [] { typeof(int) })] + int? RemainingRetentionDay { get; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; } + /// The version of the deleted blob container. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The version of the deleted blob container.", + SerializedName = @"version", + PossibleTypes = new [] { typeof(string) })] + string Version { get; } + + } + /// The blob container properties be listed out. + internal partial interface IListContainerItemInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IAzureEntityResourceInternal + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + /// Default the container to use specified encryption scope for all writes. + string DefaultEncryptionScope { get; set; } + /// Indicates whether the blob container was deleted. + bool? Deleted { get; set; } + /// Blob container deletion time. + global::System.DateTime? DeletedTime { get; set; } + /// Block override of encryption scope from the container default. + bool? DenyEncryptionScopeOverride { get; set; } + /// Enable NFSv3 all squash on blob container. + bool? EnableNfsV3AllSquash { get; set; } + /// Enable NFSv3 root squash on blob container. + bool? EnableNfsV3RootSquash { get; set; } + /// + /// The hasImmutabilityPolicy public property is set to true by SRP if ImmutabilityPolicy has been created for this container. + /// The hasImmutabilityPolicy public property is set to false by SRP if ImmutabilityPolicy has not been created for this container. + /// + bool? HasImmutabilityPolicy { get; set; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + bool? HasLegalHold { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// The ImmutabilityPolicy property of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperties ImmutabilityPolicy { get; set; } + /// ImmutabilityPolicy Etag. + string ImmutabilityPolicyEtag { get; set; } + /// The properties of an ImmutabilityPolicy of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicyProperty ImmutabilityPolicyProperty { get; set; } + /// The ImmutabilityPolicy update history of the blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty[] ImmutabilityPolicyUpdateHistory { get; set; } + /// + /// The object level immutability property of the container. The property is immutable and can only be set to true at the + /// container creation time. Existing containers must undergo a migration process. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageWithVersioning ImmutableStorageWithVersioning { get; set; } + /// + /// This is an immutable property, when set to true it enables object level immutability at the container level. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState? ImmutableStorageWithVersioningMigrationState { get; set; } + /// Returns the date and time the object level immutability was enabled. + global::System.DateTime? ImmutableStorageWithVersioningTimeStamp { get; set; } + /// Returns the date and time the container was last modified. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration? LeaseDuration { get; set; } + /// Lease state of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState? LeaseState { get; set; } + /// The lease status of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus? LeaseStatus { get; set; } + /// The LegalHold property of the container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHoldProperties LegalHold { get; set; } + /// + /// The hasLegalHold public property is set to true by SRP if there are at least one existing tag. The hasLegalHold public + /// property is set to false by SRP if all existing legal hold tags are cleared out. There can be a maximum of 1000 blob containers + /// with hasLegalHold=true for a given account. + /// + bool? LegalHoldHasLegalHold { get; set; } + /// Protected append blob writes history. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory LegalHoldProtectedAppendWritesHistory { get; set; } + /// The list of LegalHold tags of a blob container. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty[] LegalHoldTag { get; set; } + /// A name-value pair to associate with the container as metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerPropertiesMetadata Metadata { get; set; } + /// The blob container properties be listed out. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties Property { get; set; } + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + bool? ProtectedAppendWriteHistoryAllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + global::System.DateTime? ProtectedAppendWriteHistoryTimestamp { get; set; } + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess? PublicAccess { get; set; } + /// Remaining retention days for soft deleted blob container. + int? RemainingRetentionDay { get; set; } + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState? State { get; set; } + /// The version of the deleted blob container. + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.json.cs new file mode 100644 index 000000000000..721b3e324b9a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItem.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob container properties be listed out. + public partial class ListContainerItem + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListContainerItem(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListContainerItem(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __azureEntityResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.AzureEntityResource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ContainerProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __azureEntityResource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.PowerShell.cs new file mode 100644 index 000000000000..46a31156c2d4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + /// + [System.ComponentModel.TypeConverter(typeof(ListContainerItemsTypeConverter))] + public partial class ListContainerItems + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListContainerItems(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListContainerItems(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListContainerItems(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListContainerItems(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItemTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + [System.ComponentModel.TypeConverter(typeof(ListContainerItemsTypeConverter))] + public partial interface IListContainerItems + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.TypeConverter.cs new file mode 100644 index 000000000000..91c17db8a992 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListContainerItemsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListContainerItems.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListContainerItems.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListContainerItems.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.cs new file mode 100644 index 000000000000..87a2f791946f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + /// + public partial class ListContainerItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItemsInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// + /// Request URL that can be used to query next page of containers. Returned when total number of requested containers exceed + /// maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem[] _value; + + /// List of blobs containers returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem[] Value { get => this._value; } + + /// Creates an new instance. + public ListContainerItems() + { + + } + } + /// Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + public partial interface IListContainerItems : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of containers. Returned when total number of requested containers exceed + /// maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Request URL that can be used to query next page of containers. Returned when total number of requested containers exceed maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of blobs containers returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of blobs containers returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem[] Value { get; } + + } + /// Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + internal partial interface IListContainerItemsInternal + + { + /// + /// Request URL that can be used to query next page of containers. Returned when total number of requested containers exceed + /// maximum page size. + /// + string NextLink { get; set; } + /// List of blobs containers returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.json.cs new file mode 100644 index 000000000000..85fd3cb33b3a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListContainerItems.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Response schema. Contains list of blobs returned, and if paging is requested or required, a URL to next page of containers. + /// + public partial class ListContainerItems + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListContainerItems(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListContainerItems(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItem.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.PowerShell.cs new file mode 100644 index 000000000000..2261b82408a0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.PowerShell.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ListQueueTypeConverter))] + public partial class ListQueue + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListQueue(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListQueue(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListQueue(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueueProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("QueuePropertyMetadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListQueue(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueueProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("QueuePropertyMetadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ListQueueTypeConverter))] + public partial interface IListQueue + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.TypeConverter.cs new file mode 100644 index 000000000000..992b6b17ed9a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListQueueTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListQueue.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListQueue.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListQueue.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.cs new file mode 100644 index 000000000000..2210870e00bd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for QueueProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueInternal.QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueProperties()); set { {_queueProperty = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties _queueProperty; + + /// List Queue resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueProperties()); set => this._queueProperty = value; } + + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata QueuePropertyMetadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesInternal)QueueProperty).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesInternal)QueueProperty).Metadata = value ?? null /* model class */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ListQueue() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + public partial interface IListQueue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair that represents queue metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata QueuePropertyMetadata { get; set; } + + } + internal partial interface IListQueueInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// List Queue resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties QueueProperty { get; set; } + /// A name-value pair that represents queue metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata QueuePropertyMetadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.json.cs new file mode 100644 index 000000000000..2a37fd647b08 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueue.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueue + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListQueue(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListQueue(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_queueProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueProperties.FromJson(__jsonProperties) : QueueProperty;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._queueProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._queueProperty.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.PowerShell.cs new file mode 100644 index 000000000000..aec4db147125 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ListQueuePropertiesTypeConverter))] + public partial class ListQueueProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListQueueProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListQueueProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListQueueProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadataTypeConverter.ConvertFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListQueueProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadataTypeConverter.ConvertFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ListQueuePropertiesTypeConverter))] + public partial interface IListQueueProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.TypeConverter.cs new file mode 100644 index 000000000000..a78f92aebc42 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListQueuePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListQueueProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListQueueProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListQueueProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.cs new file mode 100644 index 000000000000..ee104646bb2c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata _metadata; + + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadata()); set => this._metadata = value; } + + /// Creates an new instance. + public ListQueueProperties() + { + + } + } + public partial interface IListQueueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair that represents queue metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata Metadata { get; set; } + + } + internal partial interface IListQueuePropertiesInternal + + { + /// A name-value pair that represents queue metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata Metadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.json.cs new file mode 100644 index 000000000000..108fd5e101f1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueProperties.json.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueueProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListQueueProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListQueueProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_metadata = If( json?.PropertyT("metadata"), out var __jsonMetadata) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadata.FromJson(__jsonMetadata) : Metadata;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._metadata.ToJson(null,serializationMode) : null, "metadata" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..0f905ca4ad31 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A name-value pair that represents queue metadata. + [System.ComponentModel.TypeConverter(typeof(ListQueuePropertiesMetadataTypeConverter))] + public partial class ListQueuePropertiesMetadata + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListQueuePropertiesMetadata(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListQueuePropertiesMetadata(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListQueuePropertiesMetadata(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListQueuePropertiesMetadata(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A name-value pair that represents queue metadata. + [System.ComponentModel.TypeConverter(typeof(ListQueuePropertiesMetadataTypeConverter))] + public partial interface IListQueuePropertiesMetadata + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..946383e526f5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListQueuePropertiesMetadataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListQueuePropertiesMetadata.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListQueuePropertiesMetadata.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListQueuePropertiesMetadata.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.cs new file mode 100644 index 000000000000..c45450034ebd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair that represents queue metadata. + public partial class ListQueuePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadataInternal + { + + /// Creates an new instance. + public ListQueuePropertiesMetadata() + { + + } + } + /// A name-value pair that represents queue metadata. + public partial interface IListQueuePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// A name-value pair that represents queue metadata. + internal partial interface IListQueuePropertiesMetadataInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.dictionary.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..6be459d35d61 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueuePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueuePropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.json.cs new file mode 100644 index 000000000000..0dced9a1ff49 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueuePropertiesMetadata.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair that represents queue metadata. + public partial class ListQueuePropertiesMetadata + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueuePropertiesMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListQueuePropertiesMetadata(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal ListQueuePropertiesMetadata(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.PowerShell.cs new file mode 100644 index 000000000000..2f1c42917951 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Response schema. Contains list of queues returned + [System.ComponentModel.TypeConverter(typeof(ListQueueResourceTypeConverter))] + public partial class ListQueueResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListQueueResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListQueueResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListQueueResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListQueueResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Response schema. Contains list of queues returned + [System.ComponentModel.TypeConverter(typeof(ListQueueResourceTypeConverter))] + public partial interface IListQueueResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.TypeConverter.cs new file mode 100644 index 000000000000..8235418bf90d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListQueueResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListQueueResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListQueueResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListQueueResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.cs new file mode 100644 index 000000000000..f28d9a44da01 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Response schema. Contains list of queues returned + public partial class ListQueueResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResourceInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Request URL that can be used to list next page of queues + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue[] _value; + + /// List of queues returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue[] Value { get => this._value; } + + /// Creates an new instance. + public ListQueueResource() + { + + } + } + /// Response schema. Contains list of queues returned + public partial interface IListQueueResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Request URL that can be used to list next page of queues + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Request URL that can be used to list next page of queues", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of queues returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of queues returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue[] Value { get; } + + } + /// Response schema. Contains list of queues returned + internal partial interface IListQueueResourceInternal + + { + /// Request URL that can be used to list next page of queues + string NextLink { get; set; } + /// List of queues returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.json.cs new file mode 100644 index 000000000000..c5c772f7a517 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueResource.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Response schema. Contains list of queues returned + public partial class ListQueueResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListQueueResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListQueueResource(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueue.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.PowerShell.cs new file mode 100644 index 000000000000..e5040b9186b9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ListQueueServicesTypeConverter))] + public partial class ListQueueServices + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListQueueServices(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListQueueServices(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListQueueServices(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListQueueServices(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ListQueueServicesTypeConverter))] + public partial interface IListQueueServices + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.TypeConverter.cs new file mode 100644 index 000000000000..022b5c6ca29d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListQueueServicesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListQueueServices.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListQueueServices.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListQueueServices.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.cs new file mode 100644 index 000000000000..08c0bbb78929 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueueServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServicesInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServicesInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties[] _value; + + /// List of queue services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties[] Value { get => this._value; } + + /// Creates an new instance. + public ListQueueServices() + { + + } + } + public partial interface IListQueueServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of queue services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of queue services returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties[] Value { get; } + + } + internal partial interface IListQueueServicesInternal + + { + /// List of queue services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.json.cs new file mode 100644 index 000000000000..948b1485bbfc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListQueueServices.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListQueueServices + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListQueueServices(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListQueueServices(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServiceProperties.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.PowerShell.cs new file mode 100644 index 000000000000..fb5054d80a05 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The List service SAS credentials operation response. + [System.ComponentModel.TypeConverter(typeof(ListServiceSasResponseTypeConverter))] + public partial class ListServiceSasResponse + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListServiceSasResponse(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListServiceSasResponse(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListServiceSasResponse(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponseInternal)this).ServiceSasToken = (string) content.GetValueForProperty("ServiceSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponseInternal)this).ServiceSasToken, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListServiceSasResponse(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceSasToken")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponseInternal)this).ServiceSasToken = (string) content.GetValueForProperty("ServiceSasToken",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponseInternal)this).ServiceSasToken, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The List service SAS credentials operation response. + [System.ComponentModel.TypeConverter(typeof(ListServiceSasResponseTypeConverter))] + public partial interface IListServiceSasResponse + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.TypeConverter.cs new file mode 100644 index 000000000000..993d69c36440 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListServiceSasResponseTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListServiceSasResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListServiceSasResponse.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListServiceSasResponse.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.cs new file mode 100644 index 000000000000..4c5bf4061076 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The List service SAS credentials operation response. + public partial class ListServiceSasResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponseInternal + { + + /// Internal Acessors for ServiceSasToken + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponseInternal.ServiceSasToken { get => this._serviceSasToken; set { {_serviceSasToken = value;} } } + + /// Backing field for property. + private string _serviceSasToken; + + /// List service SAS credentials of specific resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ServiceSasToken { get => this._serviceSasToken; } + + /// Creates an new instance. + public ListServiceSasResponse() + { + + } + } + /// The List service SAS credentials operation response. + public partial interface IListServiceSasResponse : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List service SAS credentials of specific resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List service SAS credentials of specific resource.", + SerializedName = @"serviceSasToken", + PossibleTypes = new [] { typeof(string) })] + string ServiceSasToken { get; } + + } + /// The List service SAS credentials operation response. + internal partial interface IListServiceSasResponseInternal + + { + /// List service SAS credentials of specific resource. + string ServiceSasToken { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.json.cs new file mode 100644 index 000000000000..f1bc16b93cef --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListServiceSasResponse.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The List service SAS credentials operation response. + public partial class ListServiceSasResponse + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListServiceSasResponse(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListServiceSasResponse(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serviceSasToken = If( json?.PropertyT("serviceSasToken"), out var __jsonServiceSasToken) ? (string)__jsonServiceSasToken : (string)ServiceSasToken;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._serviceSasToken)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._serviceSasToken.ToString()) : null, "serviceSasToken" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.PowerShell.cs new file mode 100644 index 000000000000..bd49ef43d47a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Response schema. Contains list of tables returned + [System.ComponentModel.TypeConverter(typeof(ListTableResourceTypeConverter))] + public partial class ListTableResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListTableResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListTableResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListTableResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListTableResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Response schema. Contains list of tables returned + [System.ComponentModel.TypeConverter(typeof(ListTableResourceTypeConverter))] + public partial interface IListTableResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.TypeConverter.cs new file mode 100644 index 000000000000..e5a709db24f4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListTableResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListTableResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListTableResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListTableResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.cs new file mode 100644 index 000000000000..9a16320a01ed --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Response schema. Contains list of tables returned + public partial class ListTableResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResourceInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// Request URL that can be used to query next page of tables + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable[] _value; + + /// List of tables returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable[] Value { get => this._value; } + + /// Creates an new instance. + public ListTableResource() + { + + } + } + /// Response schema. Contains list of tables returned + public partial interface IListTableResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Request URL that can be used to query next page of tables + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Request URL that can be used to query next page of tables", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// List of tables returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of tables returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable[] Value { get; } + + } + /// Response schema. Contains list of tables returned + internal partial interface IListTableResourceInternal + + { + /// Request URL that can be used to query next page of tables + string NextLink { get; set; } + /// List of tables returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.json.cs new file mode 100644 index 000000000000..690874eb8be4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableResource.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Response schema. Contains list of tables returned + public partial class ListTableResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListTableResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListTableResource(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.PowerShell.cs new file mode 100644 index 000000000000..896ba0843f95 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.PowerShell.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(ListTableServicesTypeConverter))] + public partial class ListTableServices + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ListTableServices(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ListTableServices(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ListTableServices(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ListTableServices(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServicesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServicesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServicePropertiesTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(ListTableServicesTypeConverter))] + public partial interface IListTableServices + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.TypeConverter.cs new file mode 100644 index 000000000000..83e92662ec1c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ListTableServicesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ListTableServices.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ListTableServices.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ListTableServices.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.cs new file mode 100644 index 000000000000..c8625811e5b3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListTableServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServicesInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServicesInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties[] _value; + + /// List of table services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties[] Value { get => this._value; } + + /// Creates an new instance. + public ListTableServices() + { + + } + } + public partial interface IListTableServices : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of table services returned. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of table services returned.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties[] Value { get; } + + } + internal partial interface IListTableServicesInternal + + { + /// List of table services returned. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.json.cs new file mode 100644 index 000000000000..5e2aea85984c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ListTableServices.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class ListTableServices + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ListTableServices(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ListTableServices(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServiceProperties.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.PowerShell.cs new file mode 100644 index 000000000000..297a24458caf --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.PowerShell.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The local user associated with the storage accounts. + [System.ComponentModel.TypeConverter(typeof(LocalUserTypeConverter))] + public partial class LocalUser + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LocalUser(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LocalUser(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LocalUser(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PermissionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LocalUser(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("SystemData")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemData = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData) content.GetValueForProperty("SystemData",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemData, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemDataTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedBy = (string) content.GetValueForProperty("SystemDataCreatedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataCreatedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataCreatedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PermissionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SystemDataCreatedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataCreatedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataCreatedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedBy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedBy = (string) content.GetValueForProperty("SystemDataLastModifiedBy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedBy, global::System.Convert.ToString); + } + if (content.Contains("SystemDataLastModifiedByType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedByType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType?) content.GetValueForProperty("SystemDataLastModifiedByType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedByType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType.CreateFrom); + } + if (content.Contains("SystemDataLastModifiedAt")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedAt = (global::System.DateTime?) content.GetValueForProperty("SystemDataLastModifiedAt",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal)this).SystemDataLastModifiedAt, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The local user associated with the storage accounts. + [System.ComponentModel.TypeConverter(typeof(LocalUserTypeConverter))] + public partial interface ILocalUser + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.TypeConverter.cs new file mode 100644 index 000000000000..81d40139b762 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LocalUserTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LocalUser.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LocalUser.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LocalUser.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.cs new file mode 100644 index 000000000000..a4f3eeec5a76 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.cs @@ -0,0 +1,298 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The local user associated with the storage accounts. + public partial class LocalUser : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Indicates whether shared key exists. Set it to false to remove existing shared key. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? HasSharedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HasSharedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HasSharedKey = value ?? default(bool); } + + /// Indicates whether ssh key exists. Set it to false to remove existing SSH key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? HasSshKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HasSshKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HasSshKey = value ?? default(bool); } + + /// + /// Indicates whether ssh password exists. Set it to false to remove existing SSH password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? HasSshPassword { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HasSshPassword; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HasSshPassword = value ?? default(bool); } + + /// Optional, local user home directory. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string HomeDirectory { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HomeDirectory; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).HomeDirectory = value ?? null; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserProperties()); set { {_property = value;} } } + + /// Internal Acessors for Sid + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal.Sid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).Sid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).Sid = value; } + + /// Internal Acessors for SystemData + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserInternal.SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData()); set { {_systemData = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// The permission scopes of the local user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] PermissionScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).PermissionScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).PermissionScope = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties _property; + + /// Storage account local user properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserProperties()); set => this._property = value; } + + /// A unique Security Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string Sid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).Sid; } + + /// Optional, local user ssh authorized keys for SFTP. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).SshAuthorizedKey; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)Property).SshAuthorizedKey = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData _systemData; + + /// Metadata pertaining to creation and last modification of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData SystemData { get => (this._systemData = this._systemData ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData()); } + + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataCreatedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedAt = value ?? default(global::System.DateTime); } + + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SystemDataCreatedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedBy = value ?? null; } + + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).CreatedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType)""); } + + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? SystemDataLastModifiedAt { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedAt = value ?? default(global::System.DateTime); } + + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SystemDataLastModifiedBy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedBy = value ?? null; } + + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemDataInternal)SystemData).LastModifiedByType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType)""); } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public LocalUser() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The local user associated with the storage accounts. + public partial interface ILocalUser : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// + /// Indicates whether shared key exists. Set it to false to remove existing shared key. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether shared key exists. Set it to false to remove existing shared key.", + SerializedName = @"hasSharedKey", + PossibleTypes = new [] { typeof(bool) })] + bool? HasSharedKey { get; set; } + /// Indicates whether ssh key exists. Set it to false to remove existing SSH key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ssh key exists. Set it to false to remove existing SSH key.", + SerializedName = @"hasSshKey", + PossibleTypes = new [] { typeof(bool) })] + bool? HasSshKey { get; set; } + /// + /// Indicates whether ssh password exists. Set it to false to remove existing SSH password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ssh password exists. Set it to false to remove existing SSH password.", + SerializedName = @"hasSshPassword", + PossibleTypes = new [] { typeof(bool) })] + bool? HasSshPassword { get; set; } + /// Optional, local user home directory. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, local user home directory.", + SerializedName = @"homeDirectory", + PossibleTypes = new [] { typeof(string) })] + string HomeDirectory { get; set; } + /// The permission scopes of the local user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The permission scopes of the local user.", + SerializedName = @"permissionScopes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] PermissionScope { get; set; } + /// A unique Security Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A unique Security Identifier that is generated by the server.", + SerializedName = @"sid", + PossibleTypes = new [] { typeof(string) })] + string Sid { get; } + /// Optional, local user ssh authorized keys for SFTP. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, local user ssh authorized keys for SFTP.", + SerializedName = @"sshAuthorizedKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get; set; } + /// The timestamp of resource creation (UTC). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource creation (UTC).", + SerializedName = @"createdAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that created the resource.", + SerializedName = @"createdBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that created the resource.", + SerializedName = @"createdByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The timestamp of resource last modification (UTC)", + SerializedName = @"lastModifiedAt", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity that last modified the resource.", + SerializedName = @"lastModifiedBy", + PossibleTypes = new [] { typeof(string) })] + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of identity that last modified the resource.", + SerializedName = @"lastModifiedByType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } + /// The local user associated with the storage accounts. + internal partial interface ILocalUserInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// + /// Indicates whether shared key exists. Set it to false to remove existing shared key. + /// + bool? HasSharedKey { get; set; } + /// Indicates whether ssh key exists. Set it to false to remove existing SSH key. + bool? HasSshKey { get; set; } + /// + /// Indicates whether ssh password exists. Set it to false to remove existing SSH password. + /// + bool? HasSshPassword { get; set; } + /// Optional, local user home directory. + string HomeDirectory { get; set; } + /// The permission scopes of the local user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] PermissionScope { get; set; } + /// Storage account local user properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties Property { get; set; } + /// A unique Security Identifier that is generated by the server. + string Sid { get; set; } + /// Optional, local user ssh authorized keys for SFTP. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get; set; } + /// Metadata pertaining to creation and last modification of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.ISystemData SystemData { get; set; } + /// The timestamp of resource creation (UTC). + global::System.DateTime? SystemDataCreatedAt { get; set; } + /// The identity that created the resource. + string SystemDataCreatedBy { get; set; } + /// The type of identity that created the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataCreatedByType { get; set; } + /// The timestamp of resource last modification (UTC) + global::System.DateTime? SystemDataLastModifiedAt { get; set; } + /// The identity that last modified the resource. + string SystemDataLastModifiedBy { get; set; } + /// The type of identity that last modified the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType? SystemDataLastModifiedByType { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.json.cs new file mode 100644 index 000000000000..0e6b4831192c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUser.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The local user associated with the storage accounts. + public partial class LocalUser + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LocalUser(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LocalUser(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserProperties.FromJson(__jsonProperties) : Property;} + {_systemData = If( json?.PropertyT("systemData"), out var __jsonSystemData) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20.SystemData.FromJson(__jsonSystemData) : SystemData;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._systemData ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._systemData.ToJson(null,serializationMode) : null, "systemData" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.PowerShell.cs new file mode 100644 index 000000000000..81e3a139cd90 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Storage Account Local User keys. + [System.ComponentModel.TypeConverter(typeof(LocalUserKeysTypeConverter))] + public partial class LocalUserKeys + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LocalUserKeys(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LocalUserKeys(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LocalUserKeys(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("SharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SharedKey = (string) content.GetValueForProperty("SharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SharedKey, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LocalUserKeys(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("SharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SharedKey = (string) content.GetValueForProperty("SharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal)this).SharedKey, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Storage Account Local User keys. + [System.ComponentModel.TypeConverter(typeof(LocalUserKeysTypeConverter))] + public partial interface ILocalUserKeys + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.TypeConverter.cs new file mode 100644 index 000000000000..6e4a5fff0936 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LocalUserKeysTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LocalUserKeys.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LocalUserKeys.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LocalUserKeys.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.cs new file mode 100644 index 000000000000..b9fb46045e6f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account Local User keys. + public partial class LocalUserKeys : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal + { + + /// Internal Acessors for SharedKey + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeysInternal.SharedKey { get => this._sharedKey; set { {_sharedKey = value;} } } + + /// Backing field for property. + private string _sharedKey; + + /// Auto generated by the server for SMB authentication. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SharedKey { get => this._sharedKey; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] _sshAuthorizedKey; + + /// Optional, local user ssh authorized keys for SFTP. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get => this._sshAuthorizedKey; set => this._sshAuthorizedKey = value; } + + /// Creates an new instance. + public LocalUserKeys() + { + + } + } + /// The Storage Account Local User keys. + public partial interface ILocalUserKeys : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Auto generated by the server for SMB authentication. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Auto generated by the server for SMB authentication.", + SerializedName = @"sharedKey", + PossibleTypes = new [] { typeof(string) })] + string SharedKey { get; } + /// Optional, local user ssh authorized keys for SFTP. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, local user ssh authorized keys for SFTP.", + SerializedName = @"sshAuthorizedKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get; set; } + + } + /// The Storage Account Local User keys. + internal partial interface ILocalUserKeysInternal + + { + /// Auto generated by the server for SMB authentication. + string SharedKey { get; set; } + /// Optional, local user ssh authorized keys for SFTP. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.json.cs new file mode 100644 index 000000000000..db3c860deb5e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserKeys.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account Local User keys. + public partial class LocalUserKeys + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LocalUserKeys(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LocalUserKeys(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sshAuthorizedKey = If( json?.PropertyT("sshAuthorizedKeys"), out var __jsonSshAuthorizedKeys) ? If( __jsonSshAuthorizedKeys as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKey.FromJson(__u) )) ))() : null : SshAuthorizedKey;} + {_sharedKey = If( json?.PropertyT("sharedKey"), out var __jsonSharedKey) ? (string)__jsonSharedKey : (string)SharedKey;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._sshAuthorizedKey) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._sshAuthorizedKey ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("sshAuthorizedKeys",__w); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sharedKey)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sharedKey.ToString()) : null, "sharedKey" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.PowerShell.cs new file mode 100644 index 000000000000..1502c578a45f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Storage Account Local User properties. + [System.ComponentModel.TypeConverter(typeof(LocalUserPropertiesTypeConverter))] + public partial class LocalUserProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LocalUserProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LocalUserProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LocalUserProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PermissionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LocalUserProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PermissionScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).PermissionScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[]) content.GetValueForProperty("PermissionScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).PermissionScope, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PermissionScopeTypeConverter.ConvertFrom)); + } + if (content.Contains("HomeDirectory")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HomeDirectory = (string) content.GetValueForProperty("HomeDirectory",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HomeDirectory, global::System.Convert.ToString); + } + if (content.Contains("SshAuthorizedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).SshAuthorizedKey = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[]) content.GetValueForProperty("SshAuthorizedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).SshAuthorizedKey, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKeyTypeConverter.ConvertFrom)); + } + if (content.Contains("Sid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).Sid = (string) content.GetValueForProperty("Sid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).Sid, global::System.Convert.ToString); + } + if (content.Contains("HasSharedKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSharedKey = (bool?) content.GetValueForProperty("HasSharedKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSharedKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshKey")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshKey = (bool?) content.GetValueForProperty("HasSshKey",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshKey, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("HasSshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshPassword = (bool?) content.GetValueForProperty("HasSshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal)this).HasSshPassword, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Storage Account Local User properties. + [System.ComponentModel.TypeConverter(typeof(LocalUserPropertiesTypeConverter))] + public partial interface ILocalUserProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.TypeConverter.cs new file mode 100644 index 000000000000..b4a5a90dbe01 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LocalUserPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LocalUserProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LocalUserProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LocalUserProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.cs new file mode 100644 index 000000000000..d03121ab9967 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account Local User properties. + public partial class LocalUserProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal + { + + /// Backing field for property. + private bool? _hasSharedKey; + + /// + /// Indicates whether shared key exists. Set it to false to remove existing shared key. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? HasSharedKey { get => this._hasSharedKey; set => this._hasSharedKey = value; } + + /// Backing field for property. + private bool? _hasSshKey; + + /// Indicates whether ssh key exists. Set it to false to remove existing SSH key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? HasSshKey { get => this._hasSshKey; set => this._hasSshKey = value; } + + /// Backing field for property. + private bool? _hasSshPassword; + + /// + /// Indicates whether ssh password exists. Set it to false to remove existing SSH password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? HasSshPassword { get => this._hasSshPassword; set => this._hasSshPassword = value; } + + /// Backing field for property. + private string _homeDirectory; + + /// Optional, local user home directory. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string HomeDirectory { get => this._homeDirectory; set => this._homeDirectory = value; } + + /// Internal Acessors for Sid + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserPropertiesInternal.Sid { get => this._sid; set { {_sid = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] _permissionScope; + + /// The permission scopes of the local user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] PermissionScope { get => this._permissionScope; set => this._permissionScope = value; } + + /// Backing field for property. + private string _sid; + + /// A unique Security Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Sid { get => this._sid; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] _sshAuthorizedKey; + + /// Optional, local user ssh authorized keys for SFTP. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get => this._sshAuthorizedKey; set => this._sshAuthorizedKey = value; } + + /// Creates an new instance. + public LocalUserProperties() + { + + } + } + /// The Storage Account Local User properties. + public partial interface ILocalUserProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Indicates whether shared key exists. Set it to false to remove existing shared key. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether shared key exists. Set it to false to remove existing shared key.", + SerializedName = @"hasSharedKey", + PossibleTypes = new [] { typeof(bool) })] + bool? HasSharedKey { get; set; } + /// Indicates whether ssh key exists. Set it to false to remove existing SSH key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ssh key exists. Set it to false to remove existing SSH key.", + SerializedName = @"hasSshKey", + PossibleTypes = new [] { typeof(bool) })] + bool? HasSshKey { get; set; } + /// + /// Indicates whether ssh password exists. Set it to false to remove existing SSH password. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ssh password exists. Set it to false to remove existing SSH password.", + SerializedName = @"hasSshPassword", + PossibleTypes = new [] { typeof(bool) })] + bool? HasSshPassword { get; set; } + /// Optional, local user home directory. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, local user home directory.", + SerializedName = @"homeDirectory", + PossibleTypes = new [] { typeof(string) })] + string HomeDirectory { get; set; } + /// The permission scopes of the local user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The permission scopes of the local user.", + SerializedName = @"permissionScopes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] PermissionScope { get; set; } + /// A unique Security Identifier that is generated by the server. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A unique Security Identifier that is generated by the server.", + SerializedName = @"sid", + PossibleTypes = new [] { typeof(string) })] + string Sid { get; } + /// Optional, local user ssh authorized keys for SFTP. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, local user ssh authorized keys for SFTP.", + SerializedName = @"sshAuthorizedKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get; set; } + + } + /// The Storage Account Local User properties. + internal partial interface ILocalUserPropertiesInternal + + { + /// + /// Indicates whether shared key exists. Set it to false to remove existing shared key. + /// + bool? HasSharedKey { get; set; } + /// Indicates whether ssh key exists. Set it to false to remove existing SSH key. + bool? HasSshKey { get; set; } + /// + /// Indicates whether ssh password exists. Set it to false to remove existing SSH password. + /// + bool? HasSshPassword { get; set; } + /// Optional, local user home directory. + string HomeDirectory { get; set; } + /// The permission scopes of the local user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] PermissionScope { get; set; } + /// A unique Security Identifier that is generated by the server. + string Sid { get; set; } + /// Optional, local user ssh authorized keys for SFTP. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.json.cs new file mode 100644 index 000000000000..86da20ea417f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserProperties.json.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account Local User properties. + public partial class LocalUserProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LocalUserProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LocalUserProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_permissionScope = If( json?.PropertyT("permissionScopes"), out var __jsonPermissionScopes) ? If( __jsonPermissionScopes as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PermissionScope.FromJson(__u) )) ))() : null : PermissionScope;} + {_homeDirectory = If( json?.PropertyT("homeDirectory"), out var __jsonHomeDirectory) ? (string)__jsonHomeDirectory : (string)HomeDirectory;} + {_sshAuthorizedKey = If( json?.PropertyT("sshAuthorizedKeys"), out var __jsonSshAuthorizedKeys) ? If( __jsonSshAuthorizedKeys as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SshPublicKey.FromJson(__p) )) ))() : null : SshAuthorizedKey;} + {_sid = If( json?.PropertyT("sid"), out var __jsonSid) ? (string)__jsonSid : (string)Sid;} + {_hasSharedKey = If( json?.PropertyT("hasSharedKey"), out var __jsonHasSharedKey) ? (bool?)__jsonHasSharedKey : HasSharedKey;} + {_hasSshKey = If( json?.PropertyT("hasSshKey"), out var __jsonHasSshKey) ? (bool?)__jsonHasSshKey : HasSshKey;} + {_hasSshPassword = If( json?.PropertyT("hasSshPassword"), out var __jsonHasSshPassword) ? (bool?)__jsonHasSshPassword : HasSshPassword;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._permissionScope) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._permissionScope ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("permissionScopes",__w); + } + AddIf( null != (((object)this._homeDirectory)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._homeDirectory.ToString()) : null, "homeDirectory" ,container.Add ); + if (null != this._sshAuthorizedKey) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._sshAuthorizedKey ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("sshAuthorizedKeys",__r); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sid)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sid.ToString()) : null, "sid" ,container.Add ); + } + AddIf( null != this._hasSharedKey ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._hasSharedKey) : null, "hasSharedKey" ,container.Add ); + AddIf( null != this._hasSshKey ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._hasSshKey) : null, "hasSshKey" ,container.Add ); + AddIf( null != this._hasSshPassword ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._hasSshPassword) : null, "hasSshPassword" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.PowerShell.cs new file mode 100644 index 000000000000..90b6783adbca --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.PowerShell.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The secrets of Storage Account Local User. + [System.ComponentModel.TypeConverter(typeof(LocalUserRegeneratePasswordResultTypeConverter))] + public partial class LocalUserRegeneratePasswordResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LocalUserRegeneratePasswordResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LocalUserRegeneratePasswordResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LocalUserRegeneratePasswordResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResultInternal)this).SshPassword = (string) content.GetValueForProperty("SshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResultInternal)this).SshPassword, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LocalUserRegeneratePasswordResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SshPassword")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResultInternal)this).SshPassword = (string) content.GetValueForProperty("SshPassword",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResultInternal)this).SshPassword, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The secrets of Storage Account Local User. + [System.ComponentModel.TypeConverter(typeof(LocalUserRegeneratePasswordResultTypeConverter))] + public partial interface ILocalUserRegeneratePasswordResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.TypeConverter.cs new file mode 100644 index 000000000000..554c1218dd4a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LocalUserRegeneratePasswordResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LocalUserRegeneratePasswordResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LocalUserRegeneratePasswordResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LocalUserRegeneratePasswordResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.cs new file mode 100644 index 000000000000..3efe156df834 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The secrets of Storage Account Local User. + public partial class LocalUserRegeneratePasswordResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResultInternal + { + + /// Internal Acessors for SshPassword + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResultInternal.SshPassword { get => this._sshPassword; set { {_sshPassword = value;} } } + + /// Backing field for property. + private string _sshPassword; + + /// + /// Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of local + /// user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SshPassword { get => this._sshPassword; } + + /// Creates an new instance. + public LocalUserRegeneratePasswordResult() + { + + } + } + /// The secrets of Storage Account Local User. + public partial interface ILocalUserRegeneratePasswordResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of local + /// user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of local user.", + SerializedName = @"sshPassword", + PossibleTypes = new [] { typeof(string) })] + string SshPassword { get; } + + } + /// The secrets of Storage Account Local User. + internal partial interface ILocalUserRegeneratePasswordResultInternal + + { + /// + /// Auto generated password by the server for SSH authentication if hasSshPassword is set to true on the creation of local + /// user. + /// + string SshPassword { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.json.cs new file mode 100644 index 000000000000..dd71974943b9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUserRegeneratePasswordResult.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The secrets of Storage Account Local User. + public partial class LocalUserRegeneratePasswordResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LocalUserRegeneratePasswordResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LocalUserRegeneratePasswordResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sshPassword = If( json?.PropertyT("sshPassword"), out var __jsonSshPassword) ? (string)__jsonSshPassword : (string)SshPassword;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._sshPassword)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sshPassword.ToString()) : null, "sshPassword" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.PowerShell.cs new file mode 100644 index 000000000000..8bfba2b55057 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// List storage account local users. + [System.ComponentModel.TypeConverter(typeof(LocalUsersTypeConverter))] + public partial class LocalUsers + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new LocalUsers(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new LocalUsers(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal LocalUsers(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsersInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal LocalUsers(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsersInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsersInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List storage account local users. + [System.ComponentModel.TypeConverter(typeof(LocalUsersTypeConverter))] + public partial interface ILocalUsers + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.TypeConverter.cs new file mode 100644 index 000000000000..cc937e9bddcb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class LocalUsersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return LocalUsers.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return LocalUsers.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return LocalUsers.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.cs new file mode 100644 index 000000000000..52f2dd13d798 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List storage account local users. + public partial class LocalUsers : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser[] _value; + + /// The local users associated with the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public LocalUsers() + { + + } + } + /// List storage account local users. + public partial interface ILocalUsers : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The local users associated with the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The local users associated with the storage account.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser[] Value { get; set; } + + } + /// List storage account local users. + internal partial interface ILocalUsersInternal + + { + /// The local users associated with the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.json.cs new file mode 100644 index 000000000000..dbdf73cbc98b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/LocalUsers.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List storage account local users. + public partial class LocalUsers + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new LocalUsers(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal LocalUsers(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUser.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.PowerShell.cs new file mode 100644 index 000000000000..518f39545b10 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Get Storage Account ManagementPolicies operation response. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyTypeConverter))] + public partial class ManagementPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Get Storage Account ManagementPolicies operation response. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyTypeConverter))] + public partial interface IManagementPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.TypeConverter.cs new file mode 100644 index 000000000000..e5c39af2be02 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.cs new file mode 100644 index 000000000000..11e072880a0c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Get Storage Account ManagementPolicies operation response. + public partial class ManagementPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Returns the date and time the ManagementPolicies was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)Property).LastModifiedTime; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal.LastModifiedTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)Property).LastModifiedTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)Property).LastModifiedTime = value; } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal.Policy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)Property).Policy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)Property).Policy = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)Property).PolicyRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)Property).PolicyRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties _property; + + /// Returns the Storage Account Data Policies Rules. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyProperties()); set => this._property = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ManagementPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The Get Storage Account ManagementPolicies operation response. + public partial interface IManagementPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// Returns the date and time the ManagementPolicies was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the ManagementPolicies was last modified.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] PolicyRule { get; set; } + + } + /// The Get Storage Account ManagementPolicies operation response. + internal partial interface IManagementPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// Returns the date and time the ManagementPolicies was last modified. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema Policy { get; set; } + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] PolicyRule { get; set; } + /// Returns the Storage Account Data Policies Rules. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties Property { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.json.cs new file mode 100644 index 000000000000..2c305061abc8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicy.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Get Storage Account ManagementPolicies operation response. + public partial class ManagementPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.PowerShell.cs new file mode 100644 index 000000000000..e4102b99ea2e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.PowerShell.cs @@ -0,0 +1,432 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Actions are applied to the filtered blobs when the execution condition is met. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyActionTypeConverter))] + public partial class ManagementPolicyAction + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicyAction(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicyAction(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicyAction(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BaseBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob) content.GetValueForProperty("BaseBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyBaseBlobTypeConverter.ConvertFrom); + } + if (content.Contains("Snapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Snapshot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot) content.GetValueForProperty("Snapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Snapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySnapShotTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Version = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Version, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyVersionTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("BaseBlobTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("BaseBlobTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("BaseBlobDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobEnableAutoTierToHotFromCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobEnableAutoTierToHotFromCool = (bool?) content.GetValueForProperty("BaseBlobEnableAutoTierToHotFromCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobEnableAutoTierToHotFromCool, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("SnapshotDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("VersionTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("VersionTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("VersionDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("BaseBlobDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("BaseBlobDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicyAction(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("BaseBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlob = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob) content.GetValueForProperty("BaseBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlob, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyBaseBlobTypeConverter.ConvertFrom); + } + if (content.Contains("Snapshot")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Snapshot = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot) content.GetValueForProperty("Snapshot",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Snapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySnapShotTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Version = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).Version, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyVersionTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("BaseBlobTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("BaseBlobTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("BaseBlobDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("BaseBlobEnableAutoTierToHotFromCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobEnableAutoTierToHotFromCool = (bool?) content.GetValueForProperty("BaseBlobEnableAutoTierToHotFromCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobEnableAutoTierToHotFromCool, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SnapshotTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("SnapshotTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("SnapshotDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("SnapshotDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("VersionTierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionTierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("VersionTierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("VersionDelete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDelete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("VersionDelete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDelete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("BaseBlobTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("BaseBlobDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("BaseBlobDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("BaseBlobDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).BaseBlobDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("SnapshotDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("SnapshotDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("SnapshotDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).SnapshotDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionTierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionTierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionTierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("VersionDeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("VersionDeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("VersionDeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal)this).VersionDeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Actions are applied to the filtered blobs when the execution condition is met. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyActionTypeConverter))] + public partial interface IManagementPolicyAction + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.TypeConverter.cs new file mode 100644 index 000000000000..4db70d4bead4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyActionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicyAction.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicyAction.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicyAction.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.cs new file mode 100644 index 000000000000..9d825a3877be --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.cs @@ -0,0 +1,616 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Actions are applied to the filtered blobs when the execution condition is met. + public partial class ManagementPolicyAction : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob _baseBlob; + + /// The management policy action for base blob + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob BaseBlob { get => (this._baseBlob = this._baseBlob ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyBaseBlob()); set => this._baseBlob = value; } + + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? BaseBlobDeleteDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? BaseBlobDeleteDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// + /// This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? BaseBlobEnableAutoTierToHotFromCool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).EnableAutoTierToHotFromCool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).EnableAutoTierToHotFromCool = value ?? default(bool); } + + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? BaseBlobTierToArchiveDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? BaseBlobTierToCoolDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterLastAccessTimeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).DeleteDaysAfterModificationGreaterThan = value ?? default(float); } + + /// Internal Acessors for BaseBlob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.BaseBlob { get => (this._baseBlob = this._baseBlob ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyBaseBlob()); set { {_baseBlob = value;} } } + + /// Internal Acessors for BaseBlobDelete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.BaseBlobDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).Delete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).Delete = value; } + + /// Internal Acessors for BaseBlobTierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.BaseBlobTierToArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchive = value; } + + /// Internal Acessors for BaseBlobTierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.BaseBlobTierToCool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCool = value; } + + /// Internal Acessors for Snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.Snapshot { get => (this._snapshot = this._snapshot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySnapShot()); set { {_snapshot = value;} } } + + /// Internal Acessors for SnapshotDelete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.SnapshotDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).Delete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).Delete = value; } + + /// Internal Acessors for SnapshotTierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.SnapshotTierToArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToArchive = value; } + + /// Internal Acessors for SnapshotTierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.SnapshotTierToCool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToCool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToCool = value; } + + /// Internal Acessors for Version + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.Version { get => (this._version = this._version ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyVersion()); set { {_version = value;} } } + + /// Internal Acessors for VersionDelete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.VersionDelete { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).Delete; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).Delete = value; } + + /// Internal Acessors for VersionTierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.VersionTierToArchive { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToArchive; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToArchive = value; } + + /// Internal Acessors for VersionTierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyActionInternal.VersionTierToCool { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToCool; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToCool = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot _snapshot; + + /// The management policy action for snapshot + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot Snapshot { get => (this._snapshot = this._snapshot ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySnapShot()); set => this._snapshot = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? SnapshotDeleteDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).DeleteDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).DeleteDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? SnapshotDeleteDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).DeleteDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).DeleteDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? SnapshotTierToArchiveDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToArchiveDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToArchiveDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToArchiveDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToArchiveDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? SnapshotTierToCoolDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToCoolDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToCoolDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToCoolDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)Snapshot).TierToCoolDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterLastAccessTimeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToArchiveDaysAfterModificationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterLastAccessTimeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)BaseBlob).TierToCoolDaysAfterModificationGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion _version; + + /// The management policy action for version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion Version { get => (this._version = this._version ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyVersion()); set => this._version = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? VersionDeleteDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).DeleteDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).DeleteDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? VersionDeleteDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).DeleteDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).DeleteDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? VersionTierToArchiveDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToArchiveDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToArchiveDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? VersionTierToArchiveDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToArchiveDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToArchiveDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? VersionTierToCoolDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToCoolDaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToCoolDaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? VersionTierToCoolDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToCoolDaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)Version).TierToCoolDaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Creates an new instance. + public ManagementPolicyAction() + { + + } + } + /// Actions are applied to the filtered blobs when the execution condition is met. + public partial interface IManagementPolicyAction : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after blob creation.", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? BaseBlobDeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? BaseBlobDeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan.", + SerializedName = @"enableAutoTierToHotFromCool", + PossibleTypes = new [] { typeof(bool) })] + bool? BaseBlobEnableAutoTierToHotFromCool { get; set; } + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after blob creation.", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? BaseBlobTierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after blob creation.", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? BaseBlobTierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy", + SerializedName = @"daysAfterLastAccessTimeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterLastAccessTimeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last modification", + SerializedName = @"daysAfterModificationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterModificationGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? SnapshotDeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? SnapshotDeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? SnapshotTierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? SnapshotTierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy", + SerializedName = @"daysAfterLastAccessTimeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterLastAccessTimeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last modification", + SerializedName = @"daysAfterModificationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterModificationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy", + SerializedName = @"daysAfterLastAccessTimeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterLastAccessTimeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last modification", + SerializedName = @"daysAfterModificationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterModificationGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? VersionDeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? VersionDeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? VersionTierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? VersionTierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? VersionTierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? VersionTierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + + } + /// Actions are applied to the filtered blobs when the execution condition is met. + internal partial interface IManagementPolicyActionInternal + + { + /// The management policy action for base blob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob BaseBlob { get; set; } + /// The function to delete the blob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification BaseBlobDelete { get; set; } + /// Value indicating the age in days after blob creation. + float? BaseBlobDeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + float? BaseBlobDeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + /// + bool? BaseBlobEnableAutoTierToHotFromCool { get; set; } + /// + /// The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification BaseBlobTierToArchive { get; set; } + /// Value indicating the age in days after blob creation. + float? BaseBlobTierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + float? BaseBlobTierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// The function to tier blobs to cool storage. Support blobs currently at Hot tier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification BaseBlobTierToCool { get; set; } + /// Value indicating the age in days after blob creation. + float? BaseBlobTierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + float? BaseBlobTierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + float? DeleteDaysAfterLastAccessTimeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? DeleteDaysAfterModificationGreaterThan { get; set; } + /// The management policy action for snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot Snapshot { get; set; } + /// The function to delete the blob snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation SnapshotDelete { get; set; } + /// Value indicating the age in days after creation + float? SnapshotDeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? SnapshotDeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob snapshot to archive storage. Support blob snapshot currently at Hot or Cool tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation SnapshotTierToArchive { get; set; } + /// Value indicating the age in days after creation + float? SnapshotTierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? SnapshotTierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob snapshot to cool storage. Support blob snapshot currently at Hot tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation SnapshotTierToCool { get; set; } + /// Value indicating the age in days after creation + float? SnapshotTierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? SnapshotTierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + float? TierToArchiveDaysAfterLastAccessTimeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? TierToArchiveDaysAfterModificationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + float? TierToCoolDaysAfterLastAccessTimeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? TierToCoolDaysAfterModificationGreaterThan { get; set; } + /// The management policy action for version + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion Version { get; set; } + /// The function to delete the blob version + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation VersionDelete { get; set; } + /// Value indicating the age in days after creation + float? VersionDeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? VersionDeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob version to archive storage. Support blob version currently at Hot or Cool tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation VersionTierToArchive { get; set; } + /// Value indicating the age in days after creation + float? VersionTierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? VersionTierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob version to cool storage. Support blob version currently at Hot tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation VersionTierToCool { get; set; } + /// Value indicating the age in days after creation + float? VersionTierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? VersionTierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.json.cs new file mode 100644 index 000000000000..6400410962cd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyAction.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Actions are applied to the filtered blobs when the execution condition is met. + public partial class ManagementPolicyAction + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicyAction(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicyAction(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_baseBlob = If( json?.PropertyT("baseBlob"), out var __jsonBaseBlob) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyBaseBlob.FromJson(__jsonBaseBlob) : BaseBlob;} + {_snapshot = If( json?.PropertyT("snapshot"), out var __jsonSnapshot) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySnapShot.FromJson(__jsonSnapshot) : Snapshot;} + {_version = If( json?.PropertyT("version"), out var __jsonVersion) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyVersion.FromJson(__jsonVersion) : Version;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._baseBlob ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._baseBlob.ToJson(null,serializationMode) : null, "baseBlob" ,container.Add ); + AddIf( null != this._snapshot ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._snapshot.ToJson(null,serializationMode) : null, "snapshot" ,container.Add ); + AddIf( null != this._version ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._version.ToJson(null,serializationMode) : null, "version" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.PowerShell.cs new file mode 100644 index 000000000000..b1edf6a3e43a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.PowerShell.cs @@ -0,0 +1,264 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Management policy action for base blob. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyBaseBlobTypeConverter))] + public partial class ManagementPolicyBaseBlob + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicyBaseBlob(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicyBaseBlob(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicyBaseBlob(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("EnableAutoTierToHotFromCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool = (bool?) content.GetValueForProperty("EnableAutoTierToHotFromCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TierToCoolDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicyBaseBlob(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModificationTypeConverter.ConvertFrom); + } + if (content.Contains("EnableAutoTierToHotFromCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool = (bool?) content.GetValueForProperty("EnableAutoTierToHotFromCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).EnableAutoTierToHotFromCool, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("TierToCoolDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterModificationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterModificationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterModificationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastAccessTimeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastAccessTimeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastAccessTimeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterCreationGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Management policy action for base blob. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyBaseBlobTypeConverter))] + public partial interface IManagementPolicyBaseBlob + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.TypeConverter.cs new file mode 100644 index 000000000000..3b13386ee9d8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyBaseBlobTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicyBaseBlob.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicyBaseBlob.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicyBaseBlob.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.cs new file mode 100644 index 000000000000..5c88ff9c956d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.cs @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Management policy action for base blob. + public partial class ManagementPolicyBaseBlob : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification _delete; + + /// The function to delete the blob + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification()); set => this._delete = value; } + + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterLastAccessTimeGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)Delete).DaysAfterModificationGreaterThan = value ?? default(float); } + + /// Backing field for property. + private bool? _enableAutoTierToHotFromCool; + + /// + /// This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableAutoTierToHotFromCool { get => this._enableAutoTierToHotFromCool; set => this._enableAutoTierToHotFromCool = value; } + + /// Internal Acessors for Delete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal.Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification()); set { {_delete = value;} } } + + /// Internal Acessors for TierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal.TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification()); set { {_tierToArchive = value;} } } + + /// Internal Acessors for TierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlobInternal.TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification()); set { {_tierToCool = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification _tierToArchive; + + /// + /// The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification()); set => this._tierToArchive = value; } + + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterLastAccessTimeGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToArchive).DaysAfterModificationGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification _tierToCool; + + /// The function to tier blobs to cool storage. Support blobs currently at Hot tier + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification()); set => this._tierToCool = value; } + + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterLastAccessTimeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterLastAccessTimeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterLastAccessTimeGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterModificationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterModificationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModificationInternal)TierToCool).DaysAfterModificationGreaterThan = value ?? default(float); } + + /// Creates an new instance. + public ManagementPolicyBaseBlob() + { + + } + } + /// Management policy action for base blob. + public partial interface IManagementPolicyBaseBlob : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after blob creation.", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy", + SerializedName = @"daysAfterLastAccessTimeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last modification", + SerializedName = @"daysAfterModificationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterModificationGreaterThan { get; set; } + /// + /// This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan.", + SerializedName = @"enableAutoTierToHotFromCool", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableAutoTierToHotFromCool { get; set; } + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after blob creation.", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy", + SerializedName = @"daysAfterLastAccessTimeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last modification", + SerializedName = @"daysAfterModificationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterModificationGreaterThan { get; set; } + /// Value indicating the age in days after blob creation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after blob creation.", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob access. This property can only be used in conjunction with last access time tracking policy", + SerializedName = @"daysAfterLastAccessTimeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last modification", + SerializedName = @"daysAfterModificationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterModificationGreaterThan { get; set; } + + } + /// Management policy action for base blob. + internal partial interface IManagementPolicyBaseBlobInternal + + { + /// The function to delete the blob + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification Delete { get; set; } + /// Value indicating the age in days after blob creation. + float? DeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + float? DeleteDaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + float? DeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? DeleteDaysAfterModificationGreaterThan { get; set; } + /// + /// This property enables auto tiering of a blob from cool to hot on a blob access. This property requires tierToCool.daysAfterLastAccessTimeGreaterThan. + /// + bool? EnableAutoTierToHotFromCool { get; set; } + /// + /// The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification TierToArchive { get; set; } + /// Value indicating the age in days after blob creation. + float? TierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + float? TierToArchiveDaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? TierToArchiveDaysAfterModificationGreaterThan { get; set; } + /// The function to tier blobs to cool storage. Support blobs currently at Hot tier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterModification TierToCool { get; set; } + /// Value indicating the age in days after blob creation. + float? TierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob access. This property can only be used in conjunction with last access + /// time tracking policy + /// + float? TierToCoolDaysAfterLastAccessTimeGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterModificationGreaterThan to be set for baseBlobs based actions. The blob will be archived + /// if both the conditions are satisfied. + /// + float? TierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after last modification + float? TierToCoolDaysAfterModificationGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.json.cs new file mode 100644 index 000000000000..b23a5fd5bd5f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyBaseBlob.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Management policy action for base blob. + public partial class ManagementPolicyBaseBlob + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyBaseBlob FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicyBaseBlob(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicyBaseBlob(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tierToCool = If( json?.PropertyT("tierToCool"), out var __jsonTierToCool) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification.FromJson(__jsonTierToCool) : TierToCool;} + {_tierToArchive = If( json?.PropertyT("tierToArchive"), out var __jsonTierToArchive) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification.FromJson(__jsonTierToArchive) : TierToArchive;} + {_delete = If( json?.PropertyT("delete"), out var __jsonDelete) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterModification.FromJson(__jsonDelete) : Delete;} + {_enableAutoTierToHotFromCool = If( json?.PropertyT("enableAutoTierToHotFromCool"), out var __jsonEnableAutoTierToHotFromCool) ? (bool?)__jsonEnableAutoTierToHotFromCool : EnableAutoTierToHotFromCool;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tierToCool ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToCool.ToJson(null,serializationMode) : null, "tierToCool" ,container.Add ); + AddIf( null != this._tierToArchive ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToArchive.ToJson(null,serializationMode) : null, "tierToArchive" ,container.Add ); + AddIf( null != this._delete ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._delete.ToJson(null,serializationMode) : null, "delete" ,container.Add ); + AddIf( null != this._enableAutoTierToHotFromCool ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableAutoTierToHotFromCool) : null, "enableAutoTierToHotFromCool" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.PowerShell.cs new file mode 100644 index 000000000000..a541b045d80f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.PowerShell.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + /// + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyDefinitionTypeConverter))] + public partial class ManagementPolicyDefinition + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicyDefinition(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicyDefinition(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicyDefinition(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicyDefinition(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyDefinitionTypeConverter))] + public partial interface IManagementPolicyDefinition + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.TypeConverter.cs new file mode 100644 index 000000000000..04d279cd7f01 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyDefinitionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicyDefinition.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicyDefinition.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicyDefinition.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.cs new file mode 100644 index 000000000000..4a33465aa480 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + /// + public partial class ManagementPolicyDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction _action; + + /// An object that defines the action set. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction Action { get => (this._action = this._action ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyAction()); set => this._action = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter _filter; + + /// An object that defines the filter set. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilter()); set => this._filter = value; } + + /// An array of blob index tag based filters, there can be at most 10 tag filters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] FilterBlobIndexMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)Filter).BlobIndexMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)Filter).BlobIndexMatch = value ?? null /* arrayOf */; } + + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterBlobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)Filter).BlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)Filter).BlobType = value ?? null /* arrayOf */; } + + /// An array of strings for prefixes to be match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterPrefixMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)Filter).PrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)Filter).PrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilter()); set { {_filter = value;} } } + + /// Creates an new instance. + public ManagementPolicyDefinition() + { + + } + } + /// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + public partial interface IManagementPolicyDefinition : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// An object that defines the action set. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An object that defines the action set.", + SerializedName = @"actions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction Action { get; set; } + /// An array of blob index tag based filters, there can be at most 10 tag filters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of blob index tag based filters, there can be at most 10 tag filters", + SerializedName = @"blobIndexMatch", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] FilterBlobIndexMatch { get; set; } + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are supported for appendBlob.", + SerializedName = @"blobTypes", + PossibleTypes = new [] { typeof(string) })] + string[] FilterBlobType { get; set; } + /// An array of strings for prefixes to be match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings for prefixes to be match.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] FilterPrefixMatch { get; set; } + + } + /// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + internal partial interface IManagementPolicyDefinitionInternal + + { + /// An object that defines the action set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction Action { get; set; } + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter Filter { get; set; } + /// An array of blob index tag based filters, there can be at most 10 tag filters + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] FilterBlobIndexMatch { get; set; } + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + string[] FilterBlobType { get; set; } + /// An array of strings for prefixes to be match. + string[] FilterPrefixMatch { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.json.cs new file mode 100644 index 000000000000..db1ceea4ee0b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyDefinition.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// An object that defines the Lifecycle rule. Each definition is made up with a filters set and an actions set. + /// + public partial class ManagementPolicyDefinition + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicyDefinition(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicyDefinition(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_filter = If( json?.PropertyT("filters"), out var __jsonFilters) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilter.FromJson(__jsonFilters) : Filter;} + {_action = If( json?.PropertyT("actions"), out var __jsonActions) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyAction.FromJson(__jsonActions) : Action;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filters" ,container.Add ); + AddIf( null != this._action ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._action.ToJson(null,serializationMode) : null, "actions" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.PowerShell.cs new file mode 100644 index 000000000000..d265d6ccd65c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical + /// AND is performed on all filters. + /// + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyFilterTypeConverter))] + public partial class ManagementPolicyFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicyFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicyFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicyFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[]) content.GetValueForProperty("BlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicyFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobType = (string[]) content.GetValueForProperty("BlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("BlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[]) content.GetValueForProperty("BlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal)this).BlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical + /// AND is performed on all filters. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyFilterTypeConverter))] + public partial interface IManagementPolicyFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.TypeConverter.cs new file mode 100644 index 000000000000..6c0d6a852bb7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicyFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicyFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicyFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.cs new file mode 100644 index 000000000000..c83a3e873fa8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical + /// AND is performed on all filters. + /// + public partial class ManagementPolicyFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilterInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] _blobIndexMatch; + + /// An array of blob index tag based filters, there can be at most 10 tag filters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] BlobIndexMatch { get => this._blobIndexMatch; set => this._blobIndexMatch = value; } + + /// Backing field for property. + private string[] _blobType; + + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] BlobType { get => this._blobType; set => this._blobType = value; } + + /// Backing field for property. + private string[] _prefixMatch; + + /// An array of strings for prefixes to be match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] PrefixMatch { get => this._prefixMatch; set => this._prefixMatch = value; } + + /// Creates an new instance. + public ManagementPolicyFilter() + { + + } + } + /// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical + /// AND is performed on all filters. + public partial interface IManagementPolicyFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// An array of blob index tag based filters, there can be at most 10 tag filters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of blob index tag based filters, there can be at most 10 tag filters", + SerializedName = @"blobIndexMatch", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] BlobIndexMatch { get; set; } + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are supported for appendBlob.", + SerializedName = @"blobTypes", + PossibleTypes = new [] { typeof(string) })] + string[] BlobType { get; set; } + /// An array of strings for prefixes to be match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings for prefixes to be match.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] PrefixMatch { get; set; } + + } + /// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical + /// AND is performed on all filters. + internal partial interface IManagementPolicyFilterInternal + + { + /// An array of blob index tag based filters, there can be at most 10 tag filters + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] BlobIndexMatch { get; set; } + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + string[] BlobType { get; set; } + /// An array of strings for prefixes to be match. + string[] PrefixMatch { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.json.cs new file mode 100644 index 000000000000..32fd015127ef --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyFilter.json.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Filters limit rule actions to a subset of blobs within the storage account. If multiple filters are defined, a logical + /// AND is performed on all filters. + /// + public partial class ManagementPolicyFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicyFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicyFilter(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_prefixMatch = If( json?.PropertyT("prefixMatch"), out var __jsonPrefixMatch) ? If( __jsonPrefixMatch as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : PrefixMatch;} + {_blobType = If( json?.PropertyT("blobTypes"), out var __jsonBlobTypes) ? If( __jsonBlobTypes as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : BlobType;} + {_blobIndexMatch = If( json?.PropertyT("blobIndexMatch"), out var __jsonBlobIndexMatch) ? If( __jsonBlobIndexMatch as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilter.FromJson(__k) )) ))() : null : BlobIndexMatch;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._prefixMatch) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._prefixMatch ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("prefixMatch",__w); + } + if (null != this._blobType) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._blobType ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("blobTypes",__r); + } + if (null != this._blobIndexMatch) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __n in this._blobIndexMatch ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("blobIndexMatch",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..2fda502012db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Storage Account ManagementPolicy properties. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyPropertiesTypeConverter))] + public partial class ManagementPolicyProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicyProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicyProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Policy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).Policy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema) content.GetValueForProperty("Policy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).Policy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySchemaTypeConverter.ConvertFrom); + } + if (content.Contains("LastModifiedTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).LastModifiedTime = (global::System.DateTime?) content.GetValueForProperty("LastModifiedTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).LastModifiedTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("PolicyRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).PolicyRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]) content.GetValueForProperty("PolicyRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal)this).PolicyRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Storage Account ManagementPolicy properties. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyPropertiesTypeConverter))] + public partial interface IManagementPolicyProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..f78dcdac7f16 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicyProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicyProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicyProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.cs new file mode 100644 index 000000000000..b5bddb05e811 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account ManagementPolicy properties. + public partial class ManagementPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal + { + + /// Backing field for property. + private global::System.DateTime? _lastModifiedTime; + + /// Returns the date and time the ManagementPolicies was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastModifiedTime { get => this._lastModifiedTime; } + + /// Internal Acessors for LastModifiedTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal.LastModifiedTime { get => this._lastModifiedTime; set { {_lastModifiedTime = value;} } } + + /// Internal Acessors for Policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyPropertiesInternal.Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySchema()); set { {_policy = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema _policy; + + /// + /// The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema Policy { get => (this._policy = this._policy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySchema()); set => this._policy = value; } + + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] PolicyRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchemaInternal)Policy).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchemaInternal)Policy).Rule = value ; } + + /// Creates an new instance. + public ManagementPolicyProperties() + { + + } + } + /// The Storage Account ManagementPolicy properties. + public partial interface IManagementPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Returns the date and time the ManagementPolicies was last modified. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the ManagementPolicies was last modified.", + SerializedName = @"lastModifiedTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastModifiedTime { get; } + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] PolicyRule { get; set; } + + } + /// The Storage Account ManagementPolicy properties. + internal partial interface IManagementPolicyPropertiesInternal + + { + /// Returns the date and time the ManagementPolicies was last modified. + global::System.DateTime? LastModifiedTime { get; set; } + /// + /// The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema Policy { get; set; } + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] PolicyRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.json.cs new file mode 100644 index 000000000000..c47083d745cb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyProperties.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account ManagementPolicy properties. + public partial class ManagementPolicyProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicyProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_policy = If( json?.PropertyT("policy"), out var __jsonPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicySchema.FromJson(__jsonPolicy) : Policy;} + {_lastModifiedTime = If( json?.PropertyT("lastModifiedTime"), out var __jsonLastModifiedTime) ? global::System.DateTime.TryParse((string)__jsonLastModifiedTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastModifiedTimeValue) ? __jsonLastModifiedTimeValue : LastModifiedTime : LastModifiedTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._policy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._policy.ToJson(null,serializationMode) : null, "policy" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastModifiedTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastModifiedTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastModifiedTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.PowerShell.cs new file mode 100644 index 000000000000..b55fe18ef521 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyRuleTypeConverter))] + public partial class ManagementPolicyRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicyRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicyRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicyRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction) content.GetValueForProperty("DefinitionAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilterTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicyRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Definition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Definition = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition) content.GetValueForProperty("Definition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Definition, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyDefinitionTypeConverter.ConvertFrom); + } + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("DefinitionFilter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionFilter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter) content.GetValueForProperty("DefinitionFilter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionFilter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("DefinitionAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction) content.GetValueForProperty("DefinitionAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).DefinitionAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyActionTypeConverter.ConvertFrom); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobType = (string[]) content.GetValueForProperty("FilterBlobType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobType, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterBlobIndexMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[]) content.GetValueForProperty("FilterBlobIndexMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal)this).FilterBlobIndexMatch, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TagFilterTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyRuleTypeConverter))] + public partial interface IManagementPolicyRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.TypeConverter.cs new file mode 100644 index 000000000000..b49ae335833b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicyRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicyRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicyRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.cs new file mode 100644 index 000000000000..8d0879a0c5db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + public partial class ManagementPolicyRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition _definition; + + /// An object that defines the Lifecycle rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyDefinition()); set => this._definition = value; } + + /// An object that defines the action set. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction DefinitionAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).Action; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).Action = value ; } + + /// Backing field for property. + private bool? _enabled; + + /// Rule is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// An array of blob index tag based filters, there can be at most 10 tag filters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] FilterBlobIndexMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).FilterBlobIndexMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).FilterBlobIndexMatch = value ?? null /* arrayOf */; } + + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterBlobType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).FilterBlobType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).FilterBlobType = value ?? null /* arrayOf */; } + + /// An array of strings for prefixes to be match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterPrefixMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).FilterPrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).FilterPrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Definition + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal.Definition { get => (this._definition = this._definition ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyDefinition()); set { {_definition = value;} } } + + /// Internal Acessors for DefinitionFilter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal.DefinitionFilter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).Filter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinitionInternal)Definition).Filter = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRuleInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// + /// A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within + /// a policy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _type= @"Lifecycle"; + + /// The valid value is Lifecycle + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Creates an new instance. + public ManagementPolicyRule() + { + + } + } + /// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + public partial interface IManagementPolicyRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// An object that defines the action set. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"An object that defines the action set.", + SerializedName = @"actions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction DefinitionAction { get; set; } + /// Rule is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rule is enabled if set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + /// An array of blob index tag based filters, there can be at most 10 tag filters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of blob index tag based filters, there can be at most 10 tag filters", + SerializedName = @"blobIndexMatch", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] FilterBlobIndexMatch { get; set; } + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are supported for appendBlob.", + SerializedName = @"blobTypes", + PossibleTypes = new [] { typeof(string) })] + string[] FilterBlobType { get; set; } + /// An array of strings for prefixes to be match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An array of strings for prefixes to be match.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] FilterPrefixMatch { get; set; } + /// + /// A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within + /// a policy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The valid value is Lifecycle + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The valid value is Lifecycle", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + internal partial interface IManagementPolicyRuleInternal + + { + /// An object that defines the Lifecycle rule. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyDefinition Definition { get; set; } + /// An object that defines the action set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyAction DefinitionAction { get; set; } + /// An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyFilter DefinitionFilter { get; set; } + /// Rule is enabled if set to true. + bool? Enabled { get; set; } + /// An array of blob index tag based filters, there can be at most 10 tag filters + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter[] FilterBlobIndexMatch { get; set; } + /// + /// An array of predefined enum values. Currently blockBlob supports all tiering and delete actions. Only delete actions are + /// supported for appendBlob. + /// + string[] FilterBlobType { get; set; } + /// An array of strings for prefixes to be match. + string[] FilterPrefixMatch { get; set; } + /// + /// A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within + /// a policy. + /// + string Name { get; set; } + /// The valid value is Lifecycle + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.json.cs new file mode 100644 index 000000000000..3adecb9cc790 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyRule.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An object that wraps the Lifecycle rule. Each rule is uniquely defined by name. + public partial class ManagementPolicyRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicyRule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicyRule(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_definition = If( json?.PropertyT("definition"), out var __jsonDefinition) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyDefinition.FromJson(__jsonDefinition) : Definition;} + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._definition ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._definition.ToJson(null,serializationMode) : null, "definition" ,container.Add ); + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.PowerShell.cs new file mode 100644 index 000000000000..db6b324edcc9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [System.ComponentModel.TypeConverter(typeof(ManagementPolicySchemaTypeConverter))] + public partial class ManagementPolicySchema + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicySchema(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicySchema(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicySchema(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicySchema(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchemaInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchemaInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicySchemaTypeConverter))] + public partial interface IManagementPolicySchema + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.TypeConverter.cs new file mode 100644 index 000000000000..3843c8dc244b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicySchemaTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicySchema.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicySchema.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicySchema.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.cs new file mode 100644 index 000000000000..8b8c1765d1d2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + public partial class ManagementPolicySchema : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchemaInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] _rule; + + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] Rule { get => this._rule; set => this._rule = value; } + + /// Creates an new instance. + public ManagementPolicySchema() + { + + } + } + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + public partial interface IManagementPolicySchema : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] Rule { get; set; } + + } + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + internal partial interface IManagementPolicySchemaInternal + + { + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] Rule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.json.cs new file mode 100644 index 000000000000..a76a79a8cd91 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySchema.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + public partial class ManagementPolicySchema + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySchema FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicySchema(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicySchema(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicyRule.FromJson(__u) )) ))() : null : Rule;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._rule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._rule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("rules",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.PowerShell.cs new file mode 100644 index 000000000000..a918a15ac616 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Management policy action for snapshot. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicySnapShotTypeConverter))] + public partial class ManagementPolicySnapShot + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicySnapShot(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicySnapShot(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicySnapShot(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicySnapShot(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Management policy action for snapshot. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicySnapShotTypeConverter))] + public partial interface IManagementPolicySnapShot + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.TypeConverter.cs new file mode 100644 index 000000000000..9688cbd824ce --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicySnapShotTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicySnapShot.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicySnapShot.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicySnapShot.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.cs new file mode 100644 index 000000000000..8f200888c99c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Management policy action for snapshot. + public partial class ManagementPolicySnapShot : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation _delete; + + /// The function to delete the blob snapshot + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set => this._delete = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Internal Acessors for Delete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal.Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set { {_delete = value;} } } + + /// Internal Acessors for TierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal.TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set { {_tierToArchive = value;} } } + + /// Internal Acessors for TierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShotInternal.TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set { {_tierToCool = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation _tierToArchive; + + /// + /// The function to tier blob snapshot to archive storage. Support blob snapshot currently at Hot or Cool tier + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set => this._tierToArchive = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation _tierToCool; + + /// + /// The function to tier blob snapshot to cool storage. Support blob snapshot currently at Hot tier + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set => this._tierToCool = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Creates an new instance. + public ManagementPolicySnapShot() + { + + } + } + /// Management policy action for snapshot. + public partial interface IManagementPolicySnapShot : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + + } + /// Management policy action for snapshot. + internal partial interface IManagementPolicySnapShotInternal + + { + /// The function to delete the blob snapshot + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Delete { get; set; } + /// Value indicating the age in days after creation + float? DeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? DeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob snapshot to archive storage. Support blob snapshot currently at Hot or Cool tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToArchive { get; set; } + /// Value indicating the age in days after creation + float? TierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob snapshot to cool storage. Support blob snapshot currently at Hot tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToCool { get; set; } + /// Value indicating the age in days after creation + float? TierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? TierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.json.cs new file mode 100644 index 000000000000..31890eabf5da --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicySnapShot.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Management policy action for snapshot. + public partial class ManagementPolicySnapShot + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicySnapShot FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicySnapShot(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicySnapShot(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tierToCool = If( json?.PropertyT("tierToCool"), out var __jsonTierToCool) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation.FromJson(__jsonTierToCool) : TierToCool;} + {_tierToArchive = If( json?.PropertyT("tierToArchive"), out var __jsonTierToArchive) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation.FromJson(__jsonTierToArchive) : TierToArchive;} + {_delete = If( json?.PropertyT("delete"), out var __jsonDelete) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation.FromJson(__jsonDelete) : Delete;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tierToCool ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToCool.ToJson(null,serializationMode) : null, "tierToCool" ,container.Add ); + AddIf( null != this._tierToArchive ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToArchive.ToJson(null,serializationMode) : null, "tierToArchive" ,container.Add ); + AddIf( null != this._delete ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._delete.ToJson(null,serializationMode) : null, "delete" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.PowerShell.cs new file mode 100644 index 000000000000..c8d2656d93db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Management policy action for blob version. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyVersionTypeConverter))] + public partial class ManagementPolicyVersion + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ManagementPolicyVersion(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ManagementPolicyVersion(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ManagementPolicyVersion(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ManagementPolicyVersion(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TierToCool")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCool = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToCool",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCool, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToArchive")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchive = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("TierToArchive",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchive, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("Delete")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).Delete = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation) content.GetValueForProperty("Delete",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).Delete, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreationTypeConverter.ConvertFrom); + } + if (content.Contains("TierToCoolDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToCoolDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToCoolDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToCoolDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToCoolDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("TierToArchiveDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("TierToArchiveDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("TierToArchiveDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).TierToArchiveDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterCreationGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan = (float) content.GetValueForProperty("DeleteDaysAfterCreationGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterCreationGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + if (content.Contains("DeleteDaysAfterLastTierChangeGreaterThan")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterLastTierChangeGreaterThan = (float?) content.GetValueForProperty("DeleteDaysAfterLastTierChangeGreaterThan",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal)this).DeleteDaysAfterLastTierChangeGreaterThan, (__y)=> (float) global::System.Convert.ChangeType(__y, typeof(float))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Management policy action for blob version. + [System.ComponentModel.TypeConverter(typeof(ManagementPolicyVersionTypeConverter))] + public partial interface IManagementPolicyVersion + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.TypeConverter.cs new file mode 100644 index 000000000000..d4ca17ea543f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ManagementPolicyVersionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ManagementPolicyVersion.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ManagementPolicyVersion.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ManagementPolicyVersion.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.cs new file mode 100644 index 000000000000..fc031a0177f6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Management policy action for blob version. + public partial class ManagementPolicyVersion : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation _delete; + + /// The function to delete the blob version + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set => this._delete = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? DeleteDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)Delete).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Internal Acessors for Delete + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal.Delete { get => (this._delete = this._delete ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set { {_delete = value;} } } + + /// Internal Acessors for TierToArchive + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal.TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set { {_tierToArchive = value;} } } + + /// Internal Acessors for TierToCool + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersionInternal.TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set { {_tierToCool = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation _tierToArchive; + + /// + /// The function to tier blob version to archive storage. Support blob version currently at Hot or Cool tier + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToArchive { get => (this._tierToArchive = this._tierToArchive ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set => this._tierToArchive = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToArchive).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation _tierToCool; + + /// + /// The function to tier blob version to cool storage. Support blob version currently at Hot tier + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToCool { get => (this._tierToCool = this._tierToCool ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation()); set => this._tierToCool = value; } + + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterCreationGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterCreationGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterCreationGreaterThan = value ?? default(float); } + + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public float? TierToCoolDaysAfterLastTierChangeGreaterThan { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreationInternal)TierToCool).DaysAfterLastTierChangeGreaterThan = value ?? default(float); } + + /// Creates an new instance. + public ManagementPolicyVersion() + { + + } + } + /// Management policy action for blob version. + public partial interface IManagementPolicyVersion : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? DeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// Value indicating the age in days after creation + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after creation", + SerializedName = @"daysAfterCreationGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will be archived if both the conditions are satisfied.", + SerializedName = @"daysAfterLastTierChangeGreaterThan", + PossibleTypes = new [] { typeof(float) })] + float? TierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + + } + /// Management policy action for blob version. + internal partial interface IManagementPolicyVersionInternal + + { + /// The function to delete the blob version + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation Delete { get; set; } + /// Value indicating the age in days after creation + float? DeleteDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? DeleteDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob version to archive storage. Support blob version currently at Hot or Cool tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToArchive { get; set; } + /// Value indicating the age in days after creation + float? TierToArchiveDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? TierToArchiveDaysAfterLastTierChangeGreaterThan { get; set; } + /// + /// The function to tier blob version to cool storage. Support blob version currently at Hot tier + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDateAfterCreation TierToCool { get; set; } + /// Value indicating the age in days after creation + float? TierToCoolDaysAfterCreationGreaterThan { get; set; } + /// + /// Value indicating the age in days after last blob tier change time. This property is only applicable for tierToArchive + /// actions and requires daysAfterCreationGreaterThan to be set for snapshots and blob version based actions. The blob will + /// be archived if both the conditions are satisfied. + /// + float? TierToCoolDaysAfterLastTierChangeGreaterThan { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.json.cs new file mode 100644 index 000000000000..21b5d61064bc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ManagementPolicyVersion.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Management policy action for blob version. + public partial class ManagementPolicyVersion + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyVersion FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ManagementPolicyVersion(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ManagementPolicyVersion(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tierToCool = If( json?.PropertyT("tierToCool"), out var __jsonTierToCool) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation.FromJson(__jsonTierToCool) : TierToCool;} + {_tierToArchive = If( json?.PropertyT("tierToArchive"), out var __jsonTierToArchive) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation.FromJson(__jsonTierToArchive) : TierToArchive;} + {_delete = If( json?.PropertyT("delete"), out var __jsonDelete) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DateAfterCreation.FromJson(__jsonDelete) : Delete;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._tierToCool ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToCool.ToJson(null,serializationMode) : null, "tierToCool" ,container.Add ); + AddIf( null != this._tierToArchive ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tierToArchive.ToJson(null,serializationMode) : null, "tierToArchive" ,container.Add ); + AddIf( null != this._delete ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._delete.ToJson(null,serializationMode) : null, "delete" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.PowerShell.cs new file mode 100644 index 000000000000..814994a1c850 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.PowerShell.cs @@ -0,0 +1,208 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Metric specification of operation. + [System.ComponentModel.TypeConverter(typeof(MetricSpecificationTypeConverter))] + public partial class MetricSpecification + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new MetricSpecification(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new MetricSpecification(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal MetricSpecification(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + } + if (content.Contains("FillGapWithZero")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("ResourceIdDimensionNameOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).ResourceIdDimensionNameOverride = (string) content.GetValueForProperty("ResourceIdDimensionNameOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).ResourceIdDimensionNameOverride, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal MetricSpecification(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("DisplayName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayName = (string) content.GetValueForProperty("DisplayName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayName, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Unit = (string) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Unit, global::System.Convert.ToString); + } + if (content.Contains("Dimension")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Dimension = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension[]) content.GetValueForProperty("Dimension",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Dimension, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DimensionTypeConverter.ConvertFrom)); + } + if (content.Contains("AggregationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).AggregationType = (string) content.GetValueForProperty("AggregationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).AggregationType, global::System.Convert.ToString); + } + if (content.Contains("FillGapWithZero")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).FillGapWithZero = (bool?) content.GetValueForProperty("FillGapWithZero",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).FillGapWithZero, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Category")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Category = (string) content.GetValueForProperty("Category",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).Category, global::System.Convert.ToString); + } + if (content.Contains("ResourceIdDimensionNameOverride")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).ResourceIdDimensionNameOverride = (string) content.GetValueForProperty("ResourceIdDimensionNameOverride",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal)this).ResourceIdDimensionNameOverride, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Metric specification of operation. + [System.ComponentModel.TypeConverter(typeof(MetricSpecificationTypeConverter))] + public partial interface IMetricSpecification + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.TypeConverter.cs new file mode 100644 index 000000000000..983dc8cb136c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MetricSpecificationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return MetricSpecification.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return MetricSpecification.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return MetricSpecification.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.cs b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.cs new file mode 100644 index 000000000000..1977a67a6a7b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.cs @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Metric specification of operation. + public partial class MetricSpecification : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecificationInternal + { + + /// Backing field for property. + private string _aggregationType; + + /// Aggregation type could be Average. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string AggregationType { get => this._aggregationType; set => this._aggregationType = value; } + + /// Backing field for property. + private string _category; + + /// The category this metric specification belong to, could be Capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Category { get => this._category; set => this._category = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension[] _dimension; + + /// Dimensions of blobs, including blob type and access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension[] Dimension { get => this._dimension; set => this._dimension = value; } + + /// Backing field for property. + private string _displayDescription; + + /// Display description of metric specification. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DisplayDescription { get => this._displayDescription; set => this._displayDescription = value; } + + /// Backing field for property. + private string _displayName; + + /// Display name of metric specification. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DisplayName { get => this._displayName; set => this._displayName = value; } + + /// Backing field for property. + private bool? _fillGapWithZero; + + /// The property to decide fill gap with zero or not. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? FillGapWithZero { get => this._fillGapWithZero; set => this._fillGapWithZero = value; } + + /// Backing field for property. + private string _name; + + /// Name of metric specification. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _resourceIdDimensionNameOverride; + + /// Account Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ResourceIdDimensionNameOverride { get => this._resourceIdDimensionNameOverride; set => this._resourceIdDimensionNameOverride = value; } + + /// Backing field for property. + private string _unit; + + /// Unit could be Bytes or Count. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Unit { get => this._unit; set => this._unit = value; } + + /// Creates an new instance. + public MetricSpecification() + { + + } + } + /// Metric specification of operation. + public partial interface IMetricSpecification : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Aggregation type could be Average. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Aggregation type could be Average.", + SerializedName = @"aggregationType", + PossibleTypes = new [] { typeof(string) })] + string AggregationType { get; set; } + /// The category this metric specification belong to, could be Capacity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The category this metric specification belong to, could be Capacity.", + SerializedName = @"category", + PossibleTypes = new [] { typeof(string) })] + string Category { get; set; } + /// Dimensions of blobs, including blob type and access tier. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Dimensions of blobs, including blob type and access tier.", + SerializedName = @"dimensions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension[] Dimension { get; set; } + /// Display description of metric specification. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display description of metric specification.", + SerializedName = @"displayDescription", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// Display name of metric specification. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Display name of metric specification.", + SerializedName = @"displayName", + PossibleTypes = new [] { typeof(string) })] + string DisplayName { get; set; } + /// The property to decide fill gap with zero or not. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The property to decide fill gap with zero or not.", + SerializedName = @"fillGapWithZero", + PossibleTypes = new [] { typeof(bool) })] + bool? FillGapWithZero { get; set; } + /// Name of metric specification. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of metric specification.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// Account Resource Id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account Resource Id.", + SerializedName = @"resourceIdDimensionNameOverride", + PossibleTypes = new [] { typeof(string) })] + string ResourceIdDimensionNameOverride { get; set; } + /// Unit could be Bytes or Count. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Unit could be Bytes or Count.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(string) })] + string Unit { get; set; } + + } + /// Metric specification of operation. + internal partial interface IMetricSpecificationInternal + + { + /// Aggregation type could be Average. + string AggregationType { get; set; } + /// The category this metric specification belong to, could be Capacity. + string Category { get; set; } + /// Dimensions of blobs, including blob type and access tier. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension[] Dimension { get; set; } + /// Display description of metric specification. + string DisplayDescription { get; set; } + /// Display name of metric specification. + string DisplayName { get; set; } + /// The property to decide fill gap with zero or not. + bool? FillGapWithZero { get; set; } + /// Name of metric specification. + string Name { get; set; } + /// Account Resource Id. + string ResourceIdDimensionNameOverride { get; set; } + /// Unit could be Bytes or Count. + string Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.json.cs new file mode 100644 index 000000000000..e172766d5967 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/MetricSpecification.json.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Metric specification of operation. + public partial class MetricSpecification + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new MetricSpecification(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal MetricSpecification(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_displayName = If( json?.PropertyT("displayName"), out var __jsonDisplayName) ? (string)__jsonDisplayName : (string)DisplayName;} + {_displayDescription = If( json?.PropertyT("displayDescription"), out var __jsonDisplayDescription) ? (string)__jsonDisplayDescription : (string)DisplayDescription;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_dimension = If( json?.PropertyT("dimensions"), out var __jsonDimensions) ? If( __jsonDimensions as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDimension) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Dimension.FromJson(__u) )) ))() : null : Dimension;} + {_aggregationType = If( json?.PropertyT("aggregationType"), out var __jsonAggregationType) ? (string)__jsonAggregationType : (string)AggregationType;} + {_fillGapWithZero = If( json?.PropertyT("fillGapWithZero"), out var __jsonFillGapWithZero) ? (bool?)__jsonFillGapWithZero : FillGapWithZero;} + {_category = If( json?.PropertyT("category"), out var __jsonCategory) ? (string)__jsonCategory : (string)Category;} + {_resourceIdDimensionNameOverride = If( json?.PropertyT("resourceIdDimensionNameOverride"), out var __jsonResourceIdDimensionNameOverride) ? (string)__jsonResourceIdDimensionNameOverride : (string)ResourceIdDimensionNameOverride;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._displayName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._displayName.ToString()) : null, "displayName" ,container.Add ); + AddIf( null != (((object)this._displayDescription)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._displayDescription.ToString()) : null, "displayDescription" ,container.Add ); + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + if (null != this._dimension) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._dimension ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("dimensions",__w); + } + AddIf( null != (((object)this._aggregationType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._aggregationType.ToString()) : null, "aggregationType" ,container.Add ); + AddIf( null != this._fillGapWithZero ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._fillGapWithZero) : null, "fillGapWithZero" ,container.Add ); + AddIf( null != (((object)this._category)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._category.ToString()) : null, "category" ,container.Add ); + AddIf( null != (((object)this._resourceIdDimensionNameOverride)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resourceIdDimensionNameOverride.ToString()) : null, "resourceIdDimensionNameOverride" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.PowerShell.cs new file mode 100644 index 000000000000..4bc39ebc4e2d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Multichannel setting. Applies to Premium FileStorage only. + [System.ComponentModel.TypeConverter(typeof(MultichannelTypeConverter))] + public partial class Multichannel + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Multichannel(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Multichannel(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Multichannel(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannelInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannelInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Multichannel(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannelInternal)this).Enabled = (bool?) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannelInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Multichannel setting. Applies to Premium FileStorage only. + [System.ComponentModel.TypeConverter(typeof(MultichannelTypeConverter))] + public partial interface IMultichannel + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.TypeConverter.cs new file mode 100644 index 000000000000..da43a15a2389 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class MultichannelTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Multichannel.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Multichannel.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Multichannel.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.cs b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.cs new file mode 100644 index 000000000000..2bd76f0613b5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Multichannel setting. Applies to Premium FileStorage only. + public partial class Multichannel : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannelInternal + { + + /// Backing field for property. + private bool? _enabled; + + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? Enabled { get => this._enabled; set => this._enabled = value; } + + /// Creates an new instance. + public Multichannel() + { + + } + } + /// Multichannel setting. Applies to Premium FileStorage only. + public partial interface IMultichannel : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether multichannel is enabled", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? Enabled { get; set; } + + } + /// Multichannel setting. Applies to Premium FileStorage only. + internal partial interface IMultichannelInternal + + { + /// Indicates whether multichannel is enabled + bool? Enabled { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.json.cs new file mode 100644 index 000000000000..28e421a26547 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Multichannel.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Multichannel setting. Applies to Premium FileStorage only. + public partial class Multichannel + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Multichannel(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Multichannel(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool?)__jsonEnabled : Enabled;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._enabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enabled) : null, "enabled" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.PowerShell.cs new file mode 100644 index 000000000000..597ad27f2bb2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Network rule set + [System.ComponentModel.TypeConverter(typeof(NetworkRuleSetTypeConverter))] + public partial class NetworkRuleSet + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new NetworkRuleSet(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new NetworkRuleSet(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal NetworkRuleSet(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Bypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).Bypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("Bypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).Bypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("ResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).ResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("ResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).ResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("VirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).VirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("VirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).VirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("IPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).IPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("IPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).IPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).DefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("DefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).DefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal NetworkRuleSet(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Bypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).Bypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("Bypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).Bypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("ResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).ResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("ResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).ResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("VirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).VirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("VirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).VirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("IPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).IPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("IPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).IPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("DefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).DefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("DefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)this).DefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Network rule set + [System.ComponentModel.TypeConverter(typeof(NetworkRuleSetTypeConverter))] + public partial interface INetworkRuleSet + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.TypeConverter.cs new file mode 100644 index 000000000000..277e514e16c2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class NetworkRuleSetTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return NetworkRuleSet.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return NetworkRuleSet.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return NetworkRuleSet.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.cs b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.cs new file mode 100644 index 000000000000..fe6389ae5b8c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Network rule set + public partial class NetworkRuleSet : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? _bypass; + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? Bypass { get => this._bypass; set => this._bypass = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction _defaultAction; + + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction DefaultAction { get => this._defaultAction; set => this._defaultAction = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] _iPRule; + + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] IPRule { get => this._iPRule; set => this._iPRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] _resourceAccessRule; + + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] ResourceAccessRule { get => this._resourceAccessRule; set => this._resourceAccessRule = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] _virtualNetworkRule; + + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] VirtualNetworkRule { get => this._virtualNetworkRule; set => this._virtualNetworkRule = value; } + + /// Creates an new instance. + public NetworkRuleSet() + { + + } + } + /// Network rule set + public partial interface INetworkRuleSet : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? Bypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction DefaultAction { get; set; } + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] IPRule { get; set; } + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] ResourceAccessRule { get; set; } + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] VirtualNetworkRule { get; set; } + + } + /// Network rule set + internal partial interface INetworkRuleSetInternal + + { + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? Bypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction DefaultAction { get; set; } + /// Sets the IP ACL rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] IPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] ResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] VirtualNetworkRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.json.cs new file mode 100644 index 000000000000..3a5370ada78e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/NetworkRuleSet.json.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Network rule set + public partial class NetworkRuleSet + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new NetworkRuleSet(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal NetworkRuleSet(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_bypass = If( json?.PropertyT("bypass"), out var __jsonBypass) ? (string)__jsonBypass : (string)Bypass;} + {_resourceAccessRule = If( json?.PropertyT("resourceAccessRules"), out var __jsonResourceAccessRules) ? If( __jsonResourceAccessRules as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRule.FromJson(__u) )) ))() : null : ResourceAccessRule;} + {_virtualNetworkRule = If( json?.PropertyT("virtualNetworkRules"), out var __jsonVirtualNetworkRules) ? If( __jsonVirtualNetworkRules as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRule.FromJson(__p) )) ))() : null : VirtualNetworkRule;} + {_iPRule = If( json?.PropertyT("ipRules"), out var __jsonIPRules) ? If( __jsonIPRules as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRule.FromJson(__k) )) ))() : null : IPRule;} + {_defaultAction = If( json?.PropertyT("defaultAction"), out var __jsonDefaultAction) ? (string)__jsonDefaultAction : (string)DefaultAction;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._bypass)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._bypass.ToString()) : null, "bypass" ,container.Add ); + if (null != this._resourceAccessRule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._resourceAccessRule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("resourceAccessRules",__w); + } + if (null != this._virtualNetworkRule) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._virtualNetworkRule ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("virtualNetworkRules",__r); + } + if (null != this._iPRule) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __n in this._iPRule ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("ipRules",__m); + } + AddIf( null != (((object)this._defaultAction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._defaultAction.ToString()) : null, "defaultAction" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.PowerShell.cs new file mode 100644 index 000000000000..6faa3bd4853b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// List storage account object replication policies. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPoliciesTypeConverter))] + public partial class ObjectReplicationPolicies + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ObjectReplicationPolicies(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ObjectReplicationPolicies(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ObjectReplicationPolicies(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPoliciesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPoliciesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ObjectReplicationPolicies(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPoliciesInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPoliciesInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List storage account object replication policies. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPoliciesTypeConverter))] + public partial interface IObjectReplicationPolicies + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.TypeConverter.cs new file mode 100644 index 000000000000..6c0ba658e4d8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ObjectReplicationPoliciesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ObjectReplicationPolicies.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ObjectReplicationPolicies.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ObjectReplicationPolicies.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.cs new file mode 100644 index 000000000000..e9d8282210d0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List storage account object replication policies. + public partial class ObjectReplicationPolicies : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPoliciesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy[] _value; + + /// The replication policy between two storage accounts. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public ObjectReplicationPolicies() + { + + } + } + /// List storage account object replication policies. + public partial interface IObjectReplicationPolicies : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The replication policy between two storage accounts. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The replication policy between two storage accounts.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy[] Value { get; set; } + + } + /// List storage account object replication policies. + internal partial interface IObjectReplicationPoliciesInternal + + { + /// The replication policy between two storage accounts. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.json.cs new file mode 100644 index 000000000000..f03827ee66c5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicies.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// List storage account object replication policies. + public partial class ObjectReplicationPolicies + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ObjectReplicationPolicies(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ObjectReplicationPolicies(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicy.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.PowerShell.cs new file mode 100644 index 000000000000..9656dace8a7c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.PowerShell.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The replication policy between two storage accounts. Multiple rules can be defined in one policy. + /// + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyTypeConverter))] + public partial class ObjectReplicationPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ObjectReplicationPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ObjectReplicationPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ObjectReplicationPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).EnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ObjectReplicationPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).EnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The replication policy between two storage accounts. Multiple rules can be defined in one policy. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyTypeConverter))] + public partial interface IObjectReplicationPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.TypeConverter.cs new file mode 100644 index 000000000000..86b2fea56f3a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ObjectReplicationPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ObjectReplicationPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ObjectReplicationPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ObjectReplicationPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.cs new file mode 100644 index 000000000000..090c712d8a49 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The replication policy between two storage accounts. Multiple rules can be defined in one policy. + /// + public partial class ObjectReplicationPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DestinationAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).DestinationAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).DestinationAccount = value ?? null; } + + /// Indicates when the policy is enabled on the source account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? EnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).EnabledTime; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for EnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal.EnabledTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).EnabledTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).EnabledTime = value; } + + /// Internal Acessors for PolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal.PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).PolicyId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).PolicyId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyProperties()); set { {_property = value;} } } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// A unique id for object replication policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PolicyId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).PolicyId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties _property; + + /// Returns the Storage Account Object Replication Policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyProperties()); set => this._property = value; } + + /// The storage account object replication rules. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] Rule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).Rule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).Rule = value ?? null /* arrayOf */; } + + /// + /// Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SourceAccount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).SourceAccount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)Property).SourceAccount = value ?? null; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public ObjectReplicationPolicy() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The replication policy between two storage accounts. Multiple rules can be defined in one policy. + public partial interface IObjectReplicationPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// + /// Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false.", + SerializedName = @"destinationAccount", + PossibleTypes = new [] { typeof(string) })] + string DestinationAccount { get; set; } + /// Indicates when the policy is enabled on the source account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates when the policy is enabled on the source account.", + SerializedName = @"enabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EnabledTime { get; } + /// A unique id for object replication policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A unique id for object replication policy.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + string PolicyId { get; } + /// The storage account object replication rules. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account object replication rules.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] Rule { get; set; } + /// + /// Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false.", + SerializedName = @"sourceAccount", + PossibleTypes = new [] { typeof(string) })] + string SourceAccount { get; set; } + + } + /// The replication policy between two storage accounts. Multiple rules can be defined in one policy. + internal partial interface IObjectReplicationPolicyInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// + /// Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + string DestinationAccount { get; set; } + /// Indicates when the policy is enabled on the source account. + global::System.DateTime? EnabledTime { get; set; } + /// A unique id for object replication policy. + string PolicyId { get; set; } + /// Returns the Storage Account Object Replication Policy. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties Property { get; set; } + /// The storage account object replication rules. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] Rule { get; set; } + /// + /// Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + string SourceAccount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.json.cs new file mode 100644 index 000000000000..eefc47c43b3c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicy.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The replication policy between two storage accounts. Multiple rules can be defined in one policy. + /// + public partial class ObjectReplicationPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ObjectReplicationPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ObjectReplicationPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.PowerShell.cs new file mode 100644 index 000000000000..2a2f2739b596 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the + /// filter. If multiple filters are defined, a logical AND is performed on all filters. + /// + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyFilterTypeConverter))] + public partial class ObjectReplicationPolicyFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ObjectReplicationPolicyFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ObjectReplicationPolicyFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ObjectReplicationPolicyFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).MinCreationTime = (string) content.GetValueForProperty("MinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).MinCreationTime, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ObjectReplicationPolicyFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch = (string[]) content.GetValueForProperty("PrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).PrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("MinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).MinCreationTime = (string) content.GetValueForProperty("MinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)this).MinCreationTime, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the + /// filter. If multiple filters are defined, a logical AND is performed on all filters. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyFilterTypeConverter))] + public partial interface IObjectReplicationPolicyFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.TypeConverter.cs new file mode 100644 index 000000000000..cd5199b6c8ef --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ObjectReplicationPolicyFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ObjectReplicationPolicyFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ObjectReplicationPolicyFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ObjectReplicationPolicyFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.cs new file mode 100644 index 000000000000..c92d35efc9bc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.cs @@ -0,0 +1,88 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the + /// filter. If multiple filters are defined, a logical AND is performed on all filters. + /// + public partial class ObjectReplicationPolicyFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal + { + + /// Backing field for property. + private string _minCreationTime; + + /// + /// Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + /// Example: 2020-02-19T16:05:00Z + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string MinCreationTime { get => this._minCreationTime; set => this._minCreationTime = value; } + + /// Backing field for property. + private string[] _prefixMatch; + + /// + /// Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] PrefixMatch { get => this._prefixMatch; set => this._prefixMatch = value; } + + /// Creates an new instance. + public ObjectReplicationPolicyFilter() + { + + } + } + /// Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the + /// filter. If multiple filters are defined, a logical AND is performed on all filters. + public partial interface IObjectReplicationPolicyFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + /// Example: 2020-02-19T16:05:00Z + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z", + SerializedName = @"minCreationTime", + PossibleTypes = new [] { typeof(string) })] + string MinCreationTime { get; set; } + /// + /// Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Filters the results to replicate only blobs whose names begin with the specified prefix.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] PrefixMatch { get; set; } + + } + /// Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the + /// filter. If multiple filters are defined, a logical AND is performed on all filters. + internal partial interface IObjectReplicationPolicyFilterInternal + + { + /// + /// Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + /// Example: 2020-02-19T16:05:00Z + /// + string MinCreationTime { get; set; } + /// + /// Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + /// + string[] PrefixMatch { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.json.cs new file mode 100644 index 000000000000..e2a7be28cd22 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyFilter.json.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Filters limit replication to a subset of blobs within the storage account. A logical OR is performed on values in the + /// filter. If multiple filters are defined, a logical AND is performed on all filters. + /// + public partial class ObjectReplicationPolicyFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ObjectReplicationPolicyFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ObjectReplicationPolicyFilter(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_prefixMatch = If( json?.PropertyT("prefixMatch"), out var __jsonPrefixMatch) ? If( __jsonPrefixMatch as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : PrefixMatch;} + {_minCreationTime = If( json?.PropertyT("minCreationTime"), out var __jsonMinCreationTime) ? (string)__jsonMinCreationTime : (string)MinCreationTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._prefixMatch) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._prefixMatch ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("prefixMatch",__w); + } + AddIf( null != (((object)this._minCreationTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._minCreationTime.ToString()) : null, "minCreationTime" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..c8ca7eb66c75 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.PowerShell.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Storage Account ObjectReplicationPolicy properties. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyPropertiesTypeConverter))] + public partial class ObjectReplicationPolicyProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ObjectReplicationPolicyProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ObjectReplicationPolicyProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ObjectReplicationPolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).EnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ObjectReplicationPolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId = (string) content.GetValueForProperty("PolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).PolicyId, global::System.Convert.ToString); + } + if (content.Contains("EnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).EnabledTime = (global::System.DateTime?) content.GetValueForProperty("EnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).EnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SourceAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount = (string) content.GetValueForProperty("SourceAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).SourceAccount, global::System.Convert.ToString); + } + if (content.Contains("DestinationAccount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount = (string) content.GetValueForProperty("DestinationAccount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).DestinationAccount, global::System.Convert.ToString); + } + if (content.Contains("Rule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).Rule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[]) content.GetValueForProperty("Rule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal)this).Rule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Storage Account ObjectReplicationPolicy properties. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyPropertiesTypeConverter))] + public partial interface IObjectReplicationPolicyProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..19ebc2d63fdd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ObjectReplicationPolicyPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ObjectReplicationPolicyProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ObjectReplicationPolicyProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ObjectReplicationPolicyProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.cs new file mode 100644 index 000000000000..751819e9836d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account ObjectReplicationPolicy properties. + public partial class ObjectReplicationPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal + { + + /// Backing field for property. + private string _destinationAccount; + + /// + /// Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DestinationAccount { get => this._destinationAccount; set => this._destinationAccount = value; } + + /// Backing field for property. + private global::System.DateTime? _enabledTime; + + /// Indicates when the policy is enabled on the source account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? EnabledTime { get => this._enabledTime; } + + /// Internal Acessors for EnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal.EnabledTime { get => this._enabledTime; set { {_enabledTime = value;} } } + + /// Internal Acessors for PolicyId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyPropertiesInternal.PolicyId { get => this._policyId; set { {_policyId = value;} } } + + /// Backing field for property. + private string _policyId; + + /// A unique id for object replication policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PolicyId { get => this._policyId; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] _rule; + + /// The storage account object replication rules. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] Rule { get => this._rule; set => this._rule = value; } + + /// Backing field for property. + private string _sourceAccount; + + /// + /// Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SourceAccount { get => this._sourceAccount; set => this._sourceAccount = value; } + + /// Creates an new instance. + public ObjectReplicationPolicyProperties() + { + + } + } + /// The Storage Account ObjectReplicationPolicy properties. + public partial interface IObjectReplicationPolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false.", + SerializedName = @"destinationAccount", + PossibleTypes = new [] { typeof(string) })] + string DestinationAccount { get; set; } + /// Indicates when the policy is enabled on the source account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates when the policy is enabled on the source account.", + SerializedName = @"enabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? EnabledTime { get; } + /// A unique id for object replication policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A unique id for object replication policy.", + SerializedName = @"policyId", + PossibleTypes = new [] { typeof(string) })] + string PolicyId { get; } + /// The storage account object replication rules. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account object replication rules.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] Rule { get; set; } + /// + /// Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false.", + SerializedName = @"sourceAccount", + PossibleTypes = new [] { typeof(string) })] + string SourceAccount { get; set; } + + } + /// The Storage Account ObjectReplicationPolicy properties. + internal partial interface IObjectReplicationPolicyPropertiesInternal + + { + /// + /// Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + string DestinationAccount { get; set; } + /// Indicates when the policy is enabled on the source account. + global::System.DateTime? EnabledTime { get; set; } + /// A unique id for object replication policy. + string PolicyId { get; set; } + /// The storage account object replication rules. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] Rule { get; set; } + /// + /// Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + string SourceAccount { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.json.cs new file mode 100644 index 000000000000..872509e986d2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyProperties.json.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Storage Account ObjectReplicationPolicy properties. + public partial class ObjectReplicationPolicyProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ObjectReplicationPolicyProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ObjectReplicationPolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_policyId = If( json?.PropertyT("policyId"), out var __jsonPolicyId) ? (string)__jsonPolicyId : (string)PolicyId;} + {_enabledTime = If( json?.PropertyT("enabledTime"), out var __jsonEnabledTime) ? global::System.DateTime.TryParse((string)__jsonEnabledTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonEnabledTimeValue) ? __jsonEnabledTimeValue : EnabledTime : EnabledTime;} + {_sourceAccount = If( json?.PropertyT("sourceAccount"), out var __jsonSourceAccount) ? (string)__jsonSourceAccount : (string)SourceAccount;} + {_destinationAccount = If( json?.PropertyT("destinationAccount"), out var __jsonDestinationAccount) ? (string)__jsonDestinationAccount : (string)DestinationAccount;} + {_rule = If( json?.PropertyT("rules"), out var __jsonRules) ? If( __jsonRules as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyRule.FromJson(__u) )) ))() : null : Rule;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._policyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._policyId.ToString()) : null, "policyId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._enabledTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._enabledTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "enabledTime" ,container.Add ); + } + AddIf( null != (((object)this._sourceAccount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sourceAccount.ToString()) : null, "sourceAccount" ,container.Add ); + AddIf( null != (((object)this._destinationAccount)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._destinationAccount.ToString()) : null, "destinationAccount" ,container.Add ); + if (null != this._rule) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._rule ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("rules",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.PowerShell.cs new file mode 100644 index 000000000000..ddd2f5a7686e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.PowerShell.cs @@ -0,0 +1,186 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The replication policy rule between two containers. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyRuleTypeConverter))] + public partial class ObjectReplicationPolicyRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ObjectReplicationPolicyRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ObjectReplicationPolicyRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ObjectReplicationPolicyRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).RuleId = (string) content.GetValueForProperty("RuleId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).RuleId, global::System.Convert.ToString); + } + if (content.Contains("SourceContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).SourceContainer = (string) content.GetValueForProperty("SourceContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).SourceContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterMinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterMinCreationTime = (string) content.GetValueForProperty("FilterMinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterMinCreationTime, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ObjectReplicationPolicyRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Filter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).Filter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter) content.GetValueForProperty("Filter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyFilterTypeConverter.ConvertFrom); + } + if (content.Contains("RuleId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).RuleId = (string) content.GetValueForProperty("RuleId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).RuleId, global::System.Convert.ToString); + } + if (content.Contains("SourceContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).SourceContainer = (string) content.GetValueForProperty("SourceContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).SourceContainer, global::System.Convert.ToString); + } + if (content.Contains("DestinationContainer")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer = (string) content.GetValueForProperty("DestinationContainer",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).DestinationContainer, global::System.Convert.ToString); + } + if (content.Contains("FilterPrefixMatch")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch = (string[]) content.GetValueForProperty("FilterPrefixMatch",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterPrefixMatch, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("FilterMinCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterMinCreationTime = (string) content.GetValueForProperty("FilterMinCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal)this).FilterMinCreationTime, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The replication policy rule between two containers. + [System.ComponentModel.TypeConverter(typeof(ObjectReplicationPolicyRuleTypeConverter))] + public partial interface IObjectReplicationPolicyRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.TypeConverter.cs new file mode 100644 index 000000000000..ccb88b29f3d0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ObjectReplicationPolicyRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ObjectReplicationPolicyRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ObjectReplicationPolicyRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ObjectReplicationPolicyRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.cs new file mode 100644 index 000000000000..b0b8175b592d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The replication policy rule between two containers. + public partial class ObjectReplicationPolicyRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal + { + + /// Backing field for property. + private string _destinationContainer; + + /// Required. Destination container name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DestinationContainer { get => this._destinationContainer; set => this._destinationContainer = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter _filter; + + /// Optional. An object that defines the filter set. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyFilter()); set => this._filter = value; } + + /// + /// Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + /// Example: 2020-02-19T16:05:00Z + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string FilterMinCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)Filter).MinCreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)Filter).MinCreationTime = value ?? null; } + + /// + /// Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] FilterPrefixMatch { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)Filter).PrefixMatch; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilterInternal)Filter).PrefixMatch = value ?? null /* arrayOf */; } + + /// Internal Acessors for Filter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRuleInternal.Filter { get => (this._filter = this._filter ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyFilter()); set { {_filter = value;} } } + + /// Backing field for property. + private string _ruleId; + + /// + /// Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string RuleId { get => this._ruleId; set => this._ruleId = value; } + + /// Backing field for property. + private string _sourceContainer; + + /// Required. Source container name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SourceContainer { get => this._sourceContainer; set => this._sourceContainer = value; } + + /// Creates an new instance. + public ObjectReplicationPolicyRule() + { + + } + } + /// The replication policy rule between two containers. + public partial interface IObjectReplicationPolicyRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Required. Destination container name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Destination container name.", + SerializedName = @"destinationContainer", + PossibleTypes = new [] { typeof(string) })] + string DestinationContainer { get; set; } + /// + /// Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + /// Example: 2020-02-19T16:05:00Z + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z", + SerializedName = @"minCreationTime", + PossibleTypes = new [] { typeof(string) })] + string FilterMinCreationTime { get; set; } + /// + /// Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Filters the results to replicate only blobs whose names begin with the specified prefix.", + SerializedName = @"prefixMatch", + PossibleTypes = new [] { typeof(string) })] + string[] FilterPrefixMatch { get; set; } + /// + /// Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account.", + SerializedName = @"ruleId", + PossibleTypes = new [] { typeof(string) })] + string RuleId { get; set; } + /// Required. Source container name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Source container name.", + SerializedName = @"sourceContainer", + PossibleTypes = new [] { typeof(string) })] + string SourceContainer { get; set; } + + } + /// The replication policy rule between two containers. + internal partial interface IObjectReplicationPolicyRuleInternal + + { + /// Required. Destination container name. + string DestinationContainer { get; set; } + /// Optional. An object that defines the filter set. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyFilter Filter { get; set; } + /// + /// Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. + /// Example: 2020-02-19T16:05:00Z + /// + string FilterMinCreationTime { get; set; } + /// + /// Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + /// + string[] FilterPrefixMatch { get; set; } + /// + /// Rule Id is auto-generated for each new rule on destination account. It is required for put policy on source account. + /// + string RuleId { get; set; } + /// Required. Source container name. + string SourceContainer { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.json.cs new file mode 100644 index 000000000000..44ad68b3266e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ObjectReplicationPolicyRule.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The replication policy rule between two containers. + public partial class ObjectReplicationPolicyRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ObjectReplicationPolicyRule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ObjectReplicationPolicyRule(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_filter = If( json?.PropertyT("filters"), out var __jsonFilters) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicyFilter.FromJson(__jsonFilters) : Filter;} + {_ruleId = If( json?.PropertyT("ruleId"), out var __jsonRuleId) ? (string)__jsonRuleId : (string)RuleId;} + {_sourceContainer = If( json?.PropertyT("sourceContainer"), out var __jsonSourceContainer) ? (string)__jsonSourceContainer : (string)SourceContainer;} + {_destinationContainer = If( json?.PropertyT("destinationContainer"), out var __jsonDestinationContainer) ? (string)__jsonDestinationContainer : (string)DestinationContainer;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._filter ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._filter.ToJson(null,serializationMode) : null, "filters" ,container.Add ); + AddIf( null != (((object)this._ruleId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._ruleId.ToString()) : null, "ruleId" ,container.Add ); + AddIf( null != (((object)this._sourceContainer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sourceContainer.ToString()) : null, "sourceContainer" ,container.Add ); + AddIf( null != (((object)this._destinationContainer)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._destinationContainer.ToString()) : null, "destinationContainer" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Operation.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Operation.PowerShell.cs new file mode 100644 index 000000000000..9d1a9e6f9b42 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Operation.PowerShell.cs @@ -0,0 +1,216 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Storage REST API operation definition. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial class Operation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Operation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Operation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Operation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("PropertyServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).PropertyServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification) content.GetValueForProperty("PropertyServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).PropertyServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecificationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Operation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Display")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Display = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay) content.GetValueForProperty("Display",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Display, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationDisplayTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Origin")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Origin = (string) content.GetValueForProperty("Origin",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).Origin, global::System.Convert.ToString); + } + if (content.Contains("PropertyServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).PropertyServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification) content.GetValueForProperty("PropertyServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).PropertyServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("DisplayProvider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayProvider = (string) content.GetValueForProperty("DisplayProvider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayProvider, global::System.Convert.ToString); + } + if (content.Contains("DisplayResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayResource = (string) content.GetValueForProperty("DisplayResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayResource, global::System.Convert.ToString); + } + if (content.Contains("DisplayOperation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayOperation = (string) content.GetValueForProperty("DisplayOperation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayOperation, global::System.Convert.ToString); + } + if (content.Contains("DisplayDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayDescription = (string) content.GetValueForProperty("DisplayDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).DisplayDescription, global::System.Convert.ToString); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecificationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Storage REST API operation definition. + [System.ComponentModel.TypeConverter(typeof(OperationTypeConverter))] + public partial interface IOperation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Operation.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Operation.TypeConverter.cs new file mode 100644 index 000000000000..d519092dfeaa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Operation.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Operation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Operation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Operation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Operation.cs b/swaggerci/storage/generated/api/Models/Api20220501/Operation.cs new file mode 100644 index 000000000000..e5b362a906b1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Operation.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage REST API operation definition. + public partial class Operation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay _display; + + /// Display metadata associated with the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationDisplay()); set => this._display = value; } + + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DisplayDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Description = value ?? null; } + + /// Type of operation: get, read, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DisplayOperation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Operation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Operation = value ?? null; } + + /// Service provider: Microsoft Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DisplayProvider { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Provider; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Provider = value ?? null; } + + /// Resource on which the operation is performed etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string DisplayResource { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Resource; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)Display).Resource = value ?? null; } + + /// Internal Acessors for Display + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal.Display { get => (this._display = this._display ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationDisplay()); set { {_display = value;} } } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationInternal.PropertyServiceSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)Property).ServiceSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)Property).ServiceSpecification = value; } + + /// Backing field for property. + private string _name; + + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _origin; + + /// The origin of operations. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Origin { get => this._origin; set => this._origin = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties _property; + + /// Properties of operation, include metric specifications. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationProperties()); set => this._property = value; } + + /// Metric specifications of operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)Property).ServiceSpecificationMetricSpecification = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public Operation() + { + + } + } + /// Storage REST API operation definition. + public partial interface IOperation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string DisplayDescription { get; set; } + /// Type of operation: get, read, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of operation: get, read, delete, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string DisplayOperation { get; set; } + /// Service provider: Microsoft Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service provider: Microsoft Storage.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string DisplayProvider { get; set; } + /// Resource on which the operation is performed etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource on which the operation is performed etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Operation name: {provider}/{resource}/{operation}", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The origin of operations. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The origin of operations.", + SerializedName = @"origin", + PossibleTypes = new [] { typeof(string) })] + string Origin { get; set; } + /// Metric specifications of operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric specifications of operation.", + SerializedName = @"metricSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + + } + /// Storage REST API operation definition. + internal partial interface IOperationInternal + + { + /// Display metadata associated with the operation. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay Display { get; set; } + /// Description of the operation. + string DisplayDescription { get; set; } + /// Type of operation: get, read, delete, etc. + string DisplayOperation { get; set; } + /// Service provider: Microsoft Storage. + string DisplayProvider { get; set; } + /// Resource on which the operation is performed etc. + string DisplayResource { get; set; } + /// Operation name: {provider}/{resource}/{operation} + string Name { get; set; } + /// The origin of operations. + string Origin { get; set; } + /// Properties of operation, include metric specifications. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties Property { get; set; } + /// One property of operation, include metric specifications. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification PropertyServiceSpecification { get; set; } + /// Metric specifications of operation. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Operation.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Operation.json.cs new file mode 100644 index 000000000000..9339e153e738 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Operation.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage REST API operation definition. + public partial class Operation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Operation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Operation(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_display = If( json?.PropertyT("display"), out var __jsonDisplay) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationDisplay.FromJson(__jsonDisplay) : Display;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationProperties.FromJson(__jsonProperties) : Property;} + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_origin = If( json?.PropertyT("origin"), out var __jsonOrigin) ? (string)__jsonOrigin : (string)Origin;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._display ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._display.ToJson(null,serializationMode) : null, "display" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._origin)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._origin.ToString()) : null, "origin" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.PowerShell.cs new file mode 100644 index 000000000000..a2ea5317e932 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Display metadata associated with the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial class OperationDisplay + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationDisplay(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationDisplay(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationDisplay(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationDisplay(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Provider")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Provider = (string) content.GetValueForProperty("Provider",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Provider, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Resource = (string) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Resource, global::System.Convert.ToString); + } + if (content.Contains("Operation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Operation = (string) content.GetValueForProperty("Operation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Operation, global::System.Convert.ToString); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal)this).Description, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Display metadata associated with the operation. + [System.ComponentModel.TypeConverter(typeof(OperationDisplayTypeConverter))] + public partial interface IOperationDisplay + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.TypeConverter.cs new file mode 100644 index 000000000000..1a77786f2799 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationDisplayTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationDisplay.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationDisplay.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.cs new file mode 100644 index 000000000000..43981cab6ce2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Display metadata associated with the operation. + public partial class OperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplayInternal + { + + /// Backing field for property. + private string _description; + + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _operation; + + /// Type of operation: get, read, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Operation { get => this._operation; set => this._operation = value; } + + /// Backing field for property. + private string _provider; + + /// Service provider: Microsoft Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Provider { get => this._provider; set => this._provider = value; } + + /// Backing field for property. + private string _resource; + + /// Resource on which the operation is performed etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Resource { get => this._resource; set => this._resource = value; } + + /// Creates an new instance. + public OperationDisplay() + { + + } + } + /// Display metadata associated with the operation. + public partial interface IOperationDisplay : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Description of the operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Description of the operation.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// Type of operation: get, read, delete, etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Type of operation: get, read, delete, etc.", + SerializedName = @"operation", + PossibleTypes = new [] { typeof(string) })] + string Operation { get; set; } + /// Service provider: Microsoft Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Service provider: Microsoft Storage.", + SerializedName = @"provider", + PossibleTypes = new [] { typeof(string) })] + string Provider { get; set; } + /// Resource on which the operation is performed etc. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource on which the operation is performed etc.", + SerializedName = @"resource", + PossibleTypes = new [] { typeof(string) })] + string Resource { get; set; } + + } + /// Display metadata associated with the operation. + internal partial interface IOperationDisplayInternal + + { + /// Description of the operation. + string Description { get; set; } + /// Type of operation: get, read, delete, etc. + string Operation { get; set; } + /// Service provider: Microsoft Storage. + string Provider { get; set; } + /// Resource on which the operation is performed etc. + string Resource { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.json.cs new file mode 100644 index 000000000000..ee580e9d256c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationDisplay.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Display metadata associated with the operation. + public partial class OperationDisplay + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationDisplay FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new OperationDisplay(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal OperationDisplay(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_provider = If( json?.PropertyT("provider"), out var __jsonProvider) ? (string)__jsonProvider : (string)Provider;} + {_resource = If( json?.PropertyT("resource"), out var __jsonResource) ? (string)__jsonResource : (string)Resource;} + {_operation = If( json?.PropertyT("operation"), out var __jsonOperation) ? (string)__jsonOperation : (string)Operation;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._provider)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._provider.ToString()) : null, "provider" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resource.ToString()) : null, "resource" ,container.Add ); + AddIf( null != (((object)this._operation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._operation.ToString()) : null, "operation" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.PowerShell.cs new file mode 100644 index 000000000000..0c346022b334 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.PowerShell.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + /// of results. + /// + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial class OperationListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + /// of results. + [System.ComponentModel.TypeConverter(typeof(OperationListResultTypeConverter))] + public partial interface IOperationListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.TypeConverter.cs new file mode 100644 index 000000000000..21dd4accb3cd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.cs new file mode 100644 index 000000000000..03490060e98d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + /// of results. + /// + public partial class OperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation[] _value; + + /// List of Storage operations supported by the Storage resource provider. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public OperationListResult() + { + + } + } + /// Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + /// of results. + public partial interface IOperationListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of Storage operations supported by the Storage resource provider. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of Storage operations supported by the Storage resource provider.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation[] Value { get; set; } + + } + /// Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + /// of results. + internal partial interface IOperationListResultInternal + + { + /// List of Storage operations supported by the Storage resource provider. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.json.cs new file mode 100644 index 000000000000..3149dab28906 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationListResult.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Result of the request to list Storage operations. It contains a list of operations and a URL link to get the next set + /// of results. + /// + public partial class OperationListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new OperationListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal OperationListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Operation.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.PowerShell.cs new file mode 100644 index 000000000000..2f79ef7ba732 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of operation, include metric specifications. + [System.ComponentModel.TypeConverter(typeof(OperationPropertiesTypeConverter))] + public partial class OperationProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new OperationProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new OperationProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal OperationProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecificationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal OperationProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("ServiceSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification) content.GetValueForProperty("ServiceSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecification, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSpecificationTypeConverter.ConvertFrom); + } + if (content.Contains("ServiceSpecificationMetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[]) content.GetValueForProperty("ServiceSpecificationMetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal)this).ServiceSpecificationMetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecificationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of operation, include metric specifications. + [System.ComponentModel.TypeConverter(typeof(OperationPropertiesTypeConverter))] + public partial interface IOperationProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.TypeConverter.cs new file mode 100644 index 000000000000..7fe845dd9662 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class OperationPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return OperationProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return OperationProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return OperationProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.cs new file mode 100644 index 000000000000..c4f39b61f012 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of operation, include metric specifications. + public partial class OperationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal + { + + /// Internal Acessors for ServiceSpecification + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationPropertiesInternal.ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSpecification()); set { {_serviceSpecification = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification _serviceSpecification; + + /// One property of operation, include metric specifications. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification ServiceSpecification { get => (this._serviceSpecification = this._serviceSpecification ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSpecification()); set => this._serviceSpecification = value; } + + /// Metric specifications of operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecificationInternal)ServiceSpecification).MetricSpecification = value ?? null /* arrayOf */; } + + /// Creates an new instance. + public OperationProperties() + { + + } + } + /// Properties of operation, include metric specifications. + public partial interface IOperationProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Metric specifications of operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric specifications of operation.", + SerializedName = @"metricSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + + } + /// Properties of operation, include metric specifications. + internal partial interface IOperationPropertiesInternal + + { + /// One property of operation, include metric specifications. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification ServiceSpecification { get; set; } + /// Metric specifications of operation. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] ServiceSpecificationMetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.json.cs new file mode 100644 index 000000000000..64719717361a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/OperationProperties.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of operation, include metric specifications. + public partial class OperationProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new OperationProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal OperationProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_serviceSpecification = If( json?.PropertyT("serviceSpecification"), out var __jsonServiceSpecification) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSpecification.FromJson(__jsonServiceSpecification) : ServiceSpecification;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._serviceSpecification ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._serviceSpecification.ToJson(null,serializationMode) : null, "serviceSpecification" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.PowerShell.cs new file mode 100644 index 000000000000..15bd25773122 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.PowerShell.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(PermissionScopeTypeConverter))] + public partial class PermissionScope + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PermissionScope(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PermissionScope(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PermissionScope(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Permission, global::System.Convert.ToString); + } + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Service = (string) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Service, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).ResourceName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PermissionScope(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Permission, global::System.Convert.ToString); + } + if (content.Contains("Service")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Service = (string) content.GetValueForProperty("Service",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).Service, global::System.Convert.ToString); + } + if (content.Contains("ResourceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).ResourceName = (string) content.GetValueForProperty("ResourceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal)this).ResourceName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(PermissionScopeTypeConverter))] + public partial interface IPermissionScope + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.TypeConverter.cs new file mode 100644 index 000000000000..d1ff1cd91e6d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PermissionScopeTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PermissionScope.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PermissionScope.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PermissionScope.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.cs b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.cs new file mode 100644 index 000000000000..f2b237cc4b2e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class PermissionScope : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScopeInternal + { + + /// Backing field for property. + private string _permission; + + /// + /// The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Permission { get => this._permission; set => this._permission = value; } + + /// Backing field for property. + private string _resourceName; + + /// + /// The name of resource, normally the container name or the file share name, used by the local user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ResourceName { get => this._resourceName; set => this._resourceName = value; } + + /// Backing field for property. + private string _service; + + /// The service used by the local user, e.g. blob, file. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Service { get => this._service; set => this._service = value; } + + /// Creates an new instance. + public PermissionScope() + { + + } + } + public partial interface IPermissionScope : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c).", + SerializedName = @"permissions", + PossibleTypes = new [] { typeof(string) })] + string Permission { get; set; } + /// + /// The name of resource, normally the container name or the file share name, used by the local user. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of resource, normally the container name or the file share name, used by the local user.", + SerializedName = @"resourceName", + PossibleTypes = new [] { typeof(string) })] + string ResourceName { get; set; } + /// The service used by the local user, e.g. blob, file. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The service used by the local user, e.g. blob, file.", + SerializedName = @"service", + PossibleTypes = new [] { typeof(string) })] + string Service { get; set; } + + } + internal partial interface IPermissionScopeInternal + + { + /// + /// The permissions for the local user. Possible values include: Read (r), Write (w), Delete (d), List (l), and Create (c). + /// + string Permission { get; set; } + /// + /// The name of resource, normally the container name or the file share name, used by the local user. + /// + string ResourceName { get; set; } + /// The service used by the local user, e.g. blob, file. + string Service { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.json.cs new file mode 100644 index 000000000000..cef05dc9654b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PermissionScope.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class PermissionScope + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PermissionScope(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PermissionScope(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_permission = If( json?.PropertyT("permissions"), out var __jsonPermissions) ? (string)__jsonPermissions : (string)Permission;} + {_service = If( json?.PropertyT("service"), out var __jsonService) ? (string)__jsonService : (string)Service;} + {_resourceName = If( json?.PropertyT("resourceName"), out var __jsonResourceName) ? (string)__jsonResourceName : (string)ResourceName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._permission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._permission.ToString()) : null, "permissions" ,container.Add ); + AddIf( null != (((object)this._service)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._service.ToString()) : null, "service" ,container.Add ); + AddIf( null != (((object)this._resourceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resourceName.ToString()) : null, "resourceName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.PowerShell.cs new file mode 100644 index 000000000000..9b2934df76be --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Private Endpoint resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] + public partial class PrivateEndpoint + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpoint(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpoint(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpoint(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpoint(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Private Endpoint resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointTypeConverter))] + public partial interface IPrivateEndpoint + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.TypeConverter.cs new file mode 100644 index 000000000000..9a775d31a660 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpoint.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpoint.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpoint.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.cs new file mode 100644 index 000000000000..eda5d89c5702 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Private Endpoint resource. + public partial class PrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal + { + + /// Backing field for property. + private string _id; + + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Id { get => this._id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal.Id { get => this._id; set { {_id = value;} } } + + /// Creates an new instance. + public PrivateEndpoint() + { + + } + } + /// The Private Endpoint resource. + public partial interface IPrivateEndpoint : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ARM identifier for Private Endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; } + + } + /// The Private Endpoint resource. + internal partial interface IPrivateEndpointInternal + + { + /// The ARM identifier for Private Endpoint + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.json.cs new file mode 100644 index 000000000000..6af4ad04ad0e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpoint.json.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Private Endpoint resource. + public partial class PrivateEndpoint + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateEndpoint(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpoint(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.PowerShell.cs new file mode 100644 index 000000000000..40b103ad4baa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.PowerShell.cs @@ -0,0 +1,224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The Private Endpoint Connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial class PrivateEndpointConnection + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnection(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnection(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnection(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnection(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The Private Endpoint Connection resource. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionTypeConverter))] + public partial interface IPrivateEndpointConnection + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.TypeConverter.cs new file mode 100644 index 000000000000..4c9908a97427 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnection.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnection.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnection.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.cs new file mode 100644 index 000000000000..fee834412d9d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.cs @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Private Endpoint Connection resource. + public partial class PrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal.PrivateEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpoint = value; } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal.PrivateLinkServiceConnectionState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionState = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateEndpointId; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateActionRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateDescription = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).PrivateLinkServiceConnectionStateStatus = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionProperties()); set => this._property = value; } + + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)Property).ProvisioningState; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PrivateEndpointConnection() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The Private Endpoint Connection resource. + public partial interface IPrivateEndpointConnection : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ARM identifier for Private Endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the private endpoint connection resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + + } + /// The Private Endpoint Connection resource. + internal partial interface IPrivateEndpointConnectionInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// The resource of private end point. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The ARM identifier for Private Endpoint + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// Resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties Property { get; set; } + /// The provisioning state of the private endpoint connection resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.json.cs new file mode 100644 index 000000000000..10c44fc59fb8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnection.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The Private Endpoint Connection resource. + public partial class PrivateEndpointConnection + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateEndpointConnection(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnection(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.PowerShell.cs new file mode 100644 index 000000000000..5ca995f48fef --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// List of private endpoint connection associated with the specified storage account + /// + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] + public partial class PrivateEndpointConnectionListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnectionListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnectionListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnectionListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnectionListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// List of private endpoint connection associated with the specified storage account + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionListResultTypeConverter))] + public partial interface IPrivateEndpointConnectionListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.TypeConverter.cs new file mode 100644 index 000000000000..a59fc4fb0d21 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnectionListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..2fbfe48412db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// List of private endpoint connection associated with the specified storage account + /// + public partial class PrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] _value; + + /// Array of private endpoint connections + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateEndpointConnectionListResult() + { + + } + } + /// List of private endpoint connection associated with the specified storage account + public partial interface IPrivateEndpointConnectionListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Array of private endpoint connections + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of private endpoint connections", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] Value { get; set; } + + } + /// List of private endpoint connection associated with the specified storage account + internal partial interface IPrivateEndpointConnectionListResultInternal + + { + /// Array of private endpoint connections + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.json.cs new file mode 100644 index 000000000000..69038f3ed3ad --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionListResult.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// List of private endpoint connection associated with the specified storage account + /// + public partial class PrivateEndpointConnectionListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnection.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.PowerShell.cs new file mode 100644 index 000000000000..a6563188955a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.PowerShell.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the PrivateEndpointConnectProperties. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] + public partial class PrivateEndpointConnectionProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateEndpointConnectionProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateEndpointConnectionProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateEndpointConnectionProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateEndpointConnectionProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrivateEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint) content.GetValueForProperty("PrivateEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointTypeConverter.ConvertFrom); + } + if (content.Contains("PrivateLinkServiceConnectionState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState) content.GetValueForProperty("PrivateLinkServiceConnectionState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionStateTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState.CreateFrom); + } + if (content.Contains("PrivateEndpointId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId = (string) content.GetValueForProperty("PrivateEndpointId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateEndpointId, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateDescription")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateDescription",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateDescription, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired = (string) content.GetValueForProperty("PrivateLinkServiceConnectionStateActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateActionRequired, global::System.Convert.ToString); + } + if (content.Contains("PrivateLinkServiceConnectionStateStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("PrivateLinkServiceConnectionStateStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal)this).PrivateLinkServiceConnectionStateStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the PrivateEndpointConnectProperties. + [System.ComponentModel.TypeConverter(typeof(PrivateEndpointConnectionPropertiesTypeConverter))] + public partial interface IPrivateEndpointConnectionProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.TypeConverter.cs new file mode 100644 index 000000000000..374863192ee5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateEndpointConnectionPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateEndpointConnectionProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateEndpointConnectionProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..4d830d82c735 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal + { + + /// Internal Acessors for PrivateEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpoint()); set { {_privateEndpoint = value;} } } + + /// Internal Acessors for PrivateEndpointId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal.PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal)PrivateEndpoint).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal)PrivateEndpoint).Id = value; } + + /// Internal Acessors for PrivateLinkServiceConnectionState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal.PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionState()); set { {_privateLinkServiceConnectionState = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint _privateEndpoint; + + /// The resource of private end point. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint PrivateEndpoint { get => (this._privateEndpoint = this._privateEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpoint()); set => this._privateEndpoint = value; } + + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrivateEndpointId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointInternal)PrivateEndpoint).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState _privateLinkServiceConnectionState; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get => (this._privateLinkServiceConnectionState = this._privateLinkServiceConnectionState ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionState()); set => this._privateLinkServiceConnectionState = value; } + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateActionRequired { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionRequired; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).ActionRequired = value ?? null; } + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrivateLinkServiceConnectionStateDescription { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Description = value ?? null; } + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)PrivateLinkServiceConnectionState).Status = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? _provisioningState; + + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Creates an new instance. + public PrivateEndpointConnectionProperties() + { + + } + } + /// Properties of the PrivateEndpointConnectProperties. + public partial interface IPrivateEndpointConnectionProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The ARM identifier for Private Endpoint + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ARM identifier for Private Endpoint", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointId { get; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionRequired", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The provisioning state of the private endpoint connection resource.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; } + + } + /// Properties of the PrivateEndpointConnectProperties. + internal partial interface IPrivateEndpointConnectionPropertiesInternal + + { + /// The resource of private end point. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpoint PrivateEndpoint { get; set; } + /// The ARM identifier for Private Endpoint + string PrivateEndpointId { get; set; } + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string PrivateLinkServiceConnectionStateActionRequired { get; set; } + /// The reason for approval/rejection of the connection. + string PrivateLinkServiceConnectionStateDescription { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? PrivateLinkServiceConnectionStateStatus { get; set; } + /// The provisioning state of the private endpoint connection resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState? ProvisioningState { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.json.cs new file mode 100644 index 000000000000..c6c6e9b5f450 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateEndpointConnectionProperties.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the PrivateEndpointConnectProperties. + public partial class PrivateEndpointConnectionProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateEndpointConnectionProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateEndpointConnectionProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_privateEndpoint = If( json?.PropertyT("privateEndpoint"), out var __jsonPrivateEndpoint) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpoint.FromJson(__jsonPrivateEndpoint) : PrivateEndpoint;} + {_privateLinkServiceConnectionState = If( json?.PropertyT("privateLinkServiceConnectionState"), out var __jsonPrivateLinkServiceConnectionState) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkServiceConnectionState.FromJson(__jsonPrivateLinkServiceConnectionState) : PrivateLinkServiceConnectionState;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._privateEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._privateEndpoint.ToJson(null,serializationMode) : null, "privateEndpoint" ,container.Add ); + AddIf( null != this._privateLinkServiceConnectionState ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._privateLinkServiceConnectionState.ToJson(null,serializationMode) : null, "privateLinkServiceConnectionState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.PowerShell.cs new file mode 100644 index 000000000000..8aee3d2c8cd7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A private link resource + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] + public partial class PrivateLinkResource + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResource(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResource(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResource(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResource(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourcePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A private link resource + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceTypeConverter))] + public partial interface IPrivateLinkResource + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.TypeConverter.cs new file mode 100644 index 000000000000..96945ed2cad3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResource.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResource.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResource.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.cs new file mode 100644 index 000000000000..b57a3d7b2173 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.cs @@ -0,0 +1,137 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A private link resource + public partial class PrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).GroupId; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for GroupId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal.GroupId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).GroupId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).GroupId = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceProperties()); set { {_property = value;} } } + + /// Internal Acessors for RequiredMember + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceInternal.RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties _property; + + /// Resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceProperties()); set => this._property = value; } + + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] RequiredMember { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).RequiredMember; } + + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string[] RequiredZoneName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)Property).RequiredZoneName = value ?? null /* arrayOf */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public PrivateLinkResource() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// A private link resource + public partial interface IPrivateLinkResource : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource group id.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; } + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource required member names.", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredMember { get; } + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link resource Private link DNS zone name.", + SerializedName = @"requiredZoneNames", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredZoneName { get; set; } + + } + /// A private link resource + internal partial interface IPrivateLinkResourceInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// The private link resource group id. + string GroupId { get; set; } + /// Resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties Property { get; set; } + /// The private link resource required member names. + string[] RequiredMember { get; set; } + /// The private link resource Private link DNS zone name. + string[] RequiredZoneName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.json.cs new file mode 100644 index 000000000000..f97db6c206bc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResource.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A private link resource + public partial class PrivateLinkResource + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateLinkResource(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResource(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.PowerShell.cs new file mode 100644 index 000000000000..044643f8fc96 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A list of private link resources + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceListResultTypeConverter))] + public partial class PrivateLinkResourceListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResourceListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResourceListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResourceListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResourceListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A list of private link resources + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourceListResultTypeConverter))] + public partial interface IPrivateLinkResourceListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.TypeConverter.cs new file mode 100644 index 000000000000..60209d76cd3c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourceListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResourceListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResourceListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResourceListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..21121dff881d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A list of private link resources + public partial class PrivateLinkResourceListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource[] _value; + + /// Array of private link resources + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public PrivateLinkResourceListResult() + { + + } + } + /// A list of private link resources + public partial interface IPrivateLinkResourceListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Array of private link resources + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Array of private link resources", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource[] Value { get; set; } + + } + /// A list of private link resources + internal partial interface IPrivateLinkResourceListResultInternal + + { + /// Array of private link resources + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.json.cs new file mode 100644 index 000000000000..ff0fd5e2b9f7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceListResult.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A list of private link resources + public partial class PrivateLinkResourceListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateLinkResourceListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResourceListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResource.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.PowerShell.cs new file mode 100644 index 000000000000..f3f0fc16fd4b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.PowerShell.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of a private link resource. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcePropertiesTypeConverter))] + public partial class PrivateLinkResourceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkResourceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkResourceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkResourceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkResourceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("GroupId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).GroupId = (string) content.GetValueForProperty("GroupId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).GroupId, global::System.Convert.ToString); + } + if (content.Contains("RequiredMember")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember = (string[]) content.GetValueForProperty("RequiredMember",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredMember, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("RequiredZoneName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName = (string[]) content.GetValueForProperty("RequiredZoneName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal)this).RequiredZoneName, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of a private link resource. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkResourcePropertiesTypeConverter))] + public partial interface IPrivateLinkResourceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.TypeConverter.cs new file mode 100644 index 000000000000..140931bd6625 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkResourcePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkResourceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkResourceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkResourceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..40a6e56afed7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of a private link resource. + public partial class PrivateLinkResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal + { + + /// Backing field for property. + private string _groupId; + + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string GroupId { get => this._groupId; } + + /// Internal Acessors for GroupId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal.GroupId { get => this._groupId; set { {_groupId = value;} } } + + /// Internal Acessors for RequiredMember + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourcePropertiesInternal.RequiredMember { get => this._requiredMember; set { {_requiredMember = value;} } } + + /// Backing field for property. + private string[] _requiredMember; + + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] RequiredMember { get => this._requiredMember; } + + /// Backing field for property. + private string[] _requiredZoneName; + + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] RequiredZoneName { get => this._requiredZoneName; set => this._requiredZoneName = value; } + + /// Creates an new instance. + public PrivateLinkResourceProperties() + { + + } + } + /// Properties of a private link resource. + public partial interface IPrivateLinkResourceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The private link resource group id. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource group id.", + SerializedName = @"groupId", + PossibleTypes = new [] { typeof(string) })] + string GroupId { get; } + /// The private link resource required member names. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The private link resource required member names.", + SerializedName = @"requiredMembers", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredMember { get; } + /// The private link resource Private link DNS zone name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The private link resource Private link DNS zone name.", + SerializedName = @"requiredZoneNames", + PossibleTypes = new [] { typeof(string) })] + string[] RequiredZoneName { get; set; } + + } + /// Properties of a private link resource. + internal partial interface IPrivateLinkResourcePropertiesInternal + + { + /// The private link resource group id. + string GroupId { get; set; } + /// The private link resource required member names. + string[] RequiredMember { get; set; } + /// The private link resource Private link DNS zone name. + string[] RequiredZoneName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.json.cs new file mode 100644 index 000000000000..775b539bedb4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkResourceProperties.json.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of a private link resource. + public partial class PrivateLinkResourceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateLinkResourceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkResourceProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_groupId = If( json?.PropertyT("groupId"), out var __jsonGroupId) ? (string)__jsonGroupId : (string)GroupId;} + {_requiredMember = If( json?.PropertyT("requiredMembers"), out var __jsonRequiredMembers) ? If( __jsonRequiredMembers as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : RequiredMember;} + {_requiredZoneName = If( json?.PropertyT("requiredZoneNames"), out var __jsonRequiredZoneNames) ? If( __jsonRequiredZoneNames as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(string) (__p is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __o ? (string)(__o.ToString()) : null)) ))() : null : RequiredZoneName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._groupId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._groupId.ToString()) : null, "groupId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._requiredMember) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._requiredMember ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("requiredMembers",__w); + } + } + if (null != this._requiredZoneName) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._requiredZoneName ) + { + AddIf(null != (((object)__s)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__s.ToString()) : null ,__r.Add); + } + container.Add("requiredZoneNames",__r); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.PowerShell.cs new file mode 100644 index 000000000000..413a9a8736c3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.PowerShell.cs @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + [System.ComponentModel.TypeConverter(typeof(PrivateLinkServiceConnectionStateTypeConverter))] + public partial class PrivateLinkServiceConnectionState + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new PrivateLinkServiceConnectionState(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new PrivateLinkServiceConnectionState(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal PrivateLinkServiceConnectionState(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).ActionRequired = (string) content.GetValueForProperty("ActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).ActionRequired, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal PrivateLinkServiceConnectionState(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Status")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Status = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus?) content.GetValueForProperty("Status",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Status, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus.CreateFrom); + } + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("ActionRequired")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).ActionRequired = (string) content.GetValueForProperty("ActionRequired",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal)this).ActionRequired, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A collection of information about the state of the connection between service consumer and provider. + [System.ComponentModel.TypeConverter(typeof(PrivateLinkServiceConnectionStateTypeConverter))] + public partial interface IPrivateLinkServiceConnectionState + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.TypeConverter.cs new file mode 100644 index 000000000000..d369bebd5796 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class PrivateLinkServiceConnectionStateTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return PrivateLinkServiceConnectionState.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return PrivateLinkServiceConnectionState.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return PrivateLinkServiceConnectionState.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..8502656a676f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionStateInternal + { + + /// Backing field for property. + private string _actionRequired; + + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ActionRequired { get => this._actionRequired; set => this._actionRequired = value; } + + /// Backing field for property. + private string _description; + + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? _status; + + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? Status { get => this._status; set => this._status = value; } + + /// Creates an new instance. + public PrivateLinkServiceConnectionState() + { + + } + } + /// A collection of information about the state of the connection between service consumer and provider. + public partial interface IPrivateLinkServiceConnectionState : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A message indicating if changes on the service provider require any updates on the consumer.", + SerializedName = @"actionRequired", + PossibleTypes = new [] { typeof(string) })] + string ActionRequired { get; set; } + /// The reason for approval/rejection of the connection. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for approval/rejection of the connection.", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + + } + /// A collection of information about the state of the connection between service consumer and provider. + internal partial interface IPrivateLinkServiceConnectionStateInternal + + { + /// + /// A message indicating if changes on the service provider require any updates on the consumer. + /// + string ActionRequired { get; set; } + /// The reason for approval/rejection of the connection. + string Description { get; set; } + /// + /// Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus? Status { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.json.cs new file mode 100644 index 000000000000..83e21cac04f6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/PrivateLinkServiceConnectionState.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// A collection of information about the state of the connection between service consumer and provider. + /// + public partial class PrivateLinkServiceConnectionState + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkServiceConnectionState FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new PrivateLinkServiceConnectionState(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal PrivateLinkServiceConnectionState(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_status = If( json?.PropertyT("status"), out var __jsonStatus) ? (string)__jsonStatus : (string)Status;} + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_actionRequired = If( json?.PropertyT("actionRequired"), out var __jsonActionRequired) ? (string)__jsonActionRequired : (string)ActionRequired;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._status)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._status.ToString()) : null, "status" ,container.Add ); + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._actionRequired)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._actionRequired.ToString()) : null, "actionRequired" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.PowerShell.cs new file mode 100644 index 000000000000..9e9fd8e2670b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Protected append writes history setting for the blob container with Legal holds. + /// + [System.ComponentModel.TypeConverter(typeof(ProtectedAppendWritesHistoryTypeConverter))] + public partial class ProtectedAppendWritesHistory + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProtectedAppendWritesHistory(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProtectedAppendWritesHistory(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProtectedAppendWritesHistory(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).Timestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProtectedAppendWritesHistory(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal)this).Timestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Protected append writes history setting for the blob container with Legal holds. + [System.ComponentModel.TypeConverter(typeof(ProtectedAppendWritesHistoryTypeConverter))] + public partial interface IProtectedAppendWritesHistory + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.TypeConverter.cs new file mode 100644 index 000000000000..cd601e0f79ad --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProtectedAppendWritesHistoryTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProtectedAppendWritesHistory.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProtectedAppendWritesHistory.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProtectedAppendWritesHistory.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.cs new file mode 100644 index 000000000000..1cf90a847d0e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Protected append writes history setting for the blob container with Legal holds. + /// + public partial class ProtectedAppendWritesHistory : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal + { + + /// Backing field for property. + private bool? _allowProtectedAppendWritesAll; + + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowProtectedAppendWritesAll { get => this._allowProtectedAppendWritesAll; set => this._allowProtectedAppendWritesAll = value; } + + /// Internal Acessors for Timestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistoryInternal.Timestamp { get => this._timestamp; set { {_timestamp = value;} } } + + /// Backing field for property. + private global::System.DateTime? _timestamp; + + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? Timestamp { get => this._timestamp; } + + /// Creates an new instance. + public ProtectedAppendWritesHistory() + { + + } + } + /// Protected append writes history setting for the blob container with Legal holds. + public partial interface IProtectedAppendWritesHistory : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the tag was added.", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Timestamp { get; } + + } + /// Protected append writes history setting for the blob container with Legal holds. + internal partial interface IProtectedAppendWritesHistoryInternal + + { + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + /// Returns the date and time the tag was added. + global::System.DateTime? Timestamp { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.json.cs new file mode 100644 index 000000000000..72c24c7d676f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtectedAppendWritesHistory.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Protected append writes history setting for the blob container with Legal holds. + /// + public partial class ProtectedAppendWritesHistory + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtectedAppendWritesHistory FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ProtectedAppendWritesHistory(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ProtectedAppendWritesHistory(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_allowProtectedAppendWritesAll = If( json?.PropertyT("allowProtectedAppendWritesAll"), out var __jsonAllowProtectedAppendWritesAll) ? (bool?)__jsonAllowProtectedAppendWritesAll : AllowProtectedAppendWritesAll;} + {_timestamp = If( json?.PropertyT("timestamp"), out var __jsonTimestamp) ? global::System.DateTime.TryParse((string)__jsonTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimestampValue) ? __jsonTimestampValue : Timestamp : Timestamp;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._allowProtectedAppendWritesAll ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowProtectedAppendWritesAll) : null, "allowProtectedAppendWritesAll" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._timestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._timestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timestamp" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.PowerShell.cs new file mode 100644 index 000000000000..bc4fd6ff7af6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Protocol settings for file service + [System.ComponentModel.TypeConverter(typeof(ProtocolSettingsTypeConverter))] + public partial class ProtocolSettings + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ProtocolSettings(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ProtocolSettings(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ProtocolSettings(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Smb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).Smb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting) content.GetValueForProperty("Smb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).Smb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ProtocolSettings(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Smb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).Smb = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting) content.GetValueForProperty("Smb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).Smb, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSettingTypeConverter.ConvertFrom); + } + if (content.Contains("SmbMultichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbMultichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("SmbMultichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbMultichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("SmbVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbVersion = (string) content.GetValueForProperty("SmbVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbVersion, global::System.Convert.ToString); + } + if (content.Contains("SmbAuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbAuthenticationMethod = (string) content.GetValueForProperty("SmbAuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbAuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("SmbKerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption = (string) content.GetValueForProperty("SmbKerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbKerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("SmbChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbChannelEncryption = (string) content.GetValueForProperty("SmbChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).SmbChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Protocol settings for file service + [System.ComponentModel.TypeConverter(typeof(ProtocolSettingsTypeConverter))] + public partial interface IProtocolSettings + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.TypeConverter.cs new file mode 100644 index 000000000000..12a998ee3ef6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ProtocolSettingsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ProtocolSettings.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ProtocolSettings.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ProtocolSettings.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.cs new file mode 100644 index 000000000000..e47b5acadad0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Protocol settings for file service + public partial class ProtocolSettings : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal + { + + /// Internal Acessors for Smb + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal.Smb { get => (this._smb = this._smb ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSetting()); set { {_smb = value;} } } + + /// Internal Acessors for SmbMultichannel + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettingsInternal.SmbMultichannel { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).Multichannel; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).Multichannel = value; } + + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? MultichannelEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).MultichannelEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).MultichannelEnabled = value ?? default(bool); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting _smb; + + /// Setting for SMB protocol + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting Smb { get => (this._smb = this._smb ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSetting()); set => this._smb = value; } + + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbAuthenticationMethod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).AuthenticationMethod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).AuthenticationMethod = value ?? null; } + + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbChannelEncryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).ChannelEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).ChannelEncryption = value ?? null; } + + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbKerberosTicketEncryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).KerberosTicketEncryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).KerberosTicketEncryption = value ?? null; } + + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SmbVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).Version; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)Smb).Version = value ?? null; } + + /// Creates an new instance. + public ProtocolSettings() + { + + } + } + /// Protocol settings for file service + public partial interface IProtocolSettings : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether multichannel is enabled", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MultichannelEnabled { get; set; } + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter ';'.", + SerializedName = @"authenticationMethods", + PossibleTypes = new [] { typeof(string) })] + string SmbAuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'.", + SerializedName = @"channelEncryption", + PossibleTypes = new [] { typeof(string) })] + string SmbChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'", + SerializedName = @"kerberosTicketEncryption", + PossibleTypes = new [] { typeof(string) })] + string SmbKerberosTicketEncryption { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with delimiter ';'.", + SerializedName = @"versions", + PossibleTypes = new [] { typeof(string) })] + string SmbVersion { get; set; } + + } + /// Protocol settings for file service + internal partial interface IProtocolSettingsInternal + + { + /// Indicates whether multichannel is enabled + bool? MultichannelEnabled { get; set; } + /// Setting for SMB protocol + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting Smb { get; set; } + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + string SmbAuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + string SmbChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + string SmbKerberosTicketEncryption { get; set; } + /// Multichannel setting. Applies to Premium FileStorage only. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel SmbMultichannel { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + string SmbVersion { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.json.cs new file mode 100644 index 000000000000..3c1399b91940 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ProtocolSettings.json.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Protocol settings for file service + public partial class ProtocolSettings + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IProtocolSettings FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ProtocolSettings(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ProtocolSettings(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_smb = If( json?.PropertyT("smb"), out var __jsonSmb) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SmbSetting.FromJson(__jsonSmb) : Smb;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._smb ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._smb.ToJson(null,serializationMode) : null, "smb" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.PowerShell.cs new file mode 100644 index 000000000000..dedadbb330d8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(QueuePropertiesTypeConverter))] + public partial class QueueProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueueProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueueProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueueProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).ApproximateMessageCount = (int?) content.GetValueForProperty("ApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).ApproximateMessageCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueueProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Metadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).Metadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) content.GetValueForProperty("Metadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).Metadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("ApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).ApproximateMessageCount = (int?) content.GetValueForProperty("ApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)this).ApproximateMessageCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(QueuePropertiesTypeConverter))] + public partial interface IQueueProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.TypeConverter.cs new file mode 100644 index 000000000000..5b45fe61ba61 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueuePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueueProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueueProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueueProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.cs new file mode 100644 index 000000000000..aa1db43cb377 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class QueueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal + { + + /// Backing field for property. + private int? _approximateMessageCount; + + /// + /// Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of + /// messages in the queue, but could be higher. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? ApproximateMessageCount { get => this._approximateMessageCount; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata _metadata; + + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata Metadata { get => (this._metadata = this._metadata ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadata()); set => this._metadata = value; } + + /// Internal Acessors for ApproximateMessageCount + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal.ApproximateMessageCount { get => this._approximateMessageCount; set { {_approximateMessageCount = value;} } } + + /// Creates an new instance. + public QueueProperties() + { + + } + } + public partial interface IQueueProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of + /// messages in the queue, but could be higher. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher.", + SerializedName = @"approximateMessageCount", + PossibleTypes = new [] { typeof(int) })] + int? ApproximateMessageCount { get; } + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair that represents queue metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata Metadata { get; set; } + + } + internal partial interface IQueuePropertiesInternal + + { + /// + /// Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of + /// messages in the queue, but could be higher. + /// + int? ApproximateMessageCount { get; set; } + /// A name-value pair that represents queue metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata Metadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.json.cs new file mode 100644 index 000000000000..f363e09f14f0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueProperties.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class QueueProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new QueueProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal QueueProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_metadata = If( json?.PropertyT("metadata"), out var __jsonMetadata) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadata.FromJson(__jsonMetadata) : Metadata;} + {_approximateMessageCount = If( json?.PropertyT("approximateMessageCount"), out var __jsonApproximateMessageCount) ? (int?)__jsonApproximateMessageCount : ApproximateMessageCount;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._metadata ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._metadata.ToJson(null,serializationMode) : null, "metadata" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._approximateMessageCount ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._approximateMessageCount) : null, "approximateMessageCount" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.PowerShell.cs new file mode 100644 index 000000000000..dccca270589d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.PowerShell.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A name-value pair that represents queue metadata. + [System.ComponentModel.TypeConverter(typeof(QueuePropertiesMetadataTypeConverter))] + public partial class QueuePropertiesMetadata + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueuePropertiesMetadata(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueuePropertiesMetadata(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueuePropertiesMetadata(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueuePropertiesMetadata(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A name-value pair that represents queue metadata. + [System.ComponentModel.TypeConverter(typeof(QueuePropertiesMetadataTypeConverter))] + public partial interface IQueuePropertiesMetadata + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.TypeConverter.cs new file mode 100644 index 000000000000..986db32da8d5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueuePropertiesMetadataTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueuePropertiesMetadata.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueuePropertiesMetadata.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueuePropertiesMetadata.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.cs new file mode 100644 index 000000000000..3fcff52fa09a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair that represents queue metadata. + public partial class QueuePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadataInternal + { + + /// Creates an new instance. + public QueuePropertiesMetadata() + { + + } + } + /// A name-value pair that represents queue metadata. + public partial interface IQueuePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// A name-value pair that represents queue metadata. + internal partial interface IQueuePropertiesMetadataInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.dictionary.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.dictionary.cs new file mode 100644 index 000000000000..68a4ab511114 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class QueuePropertiesMetadata : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadata source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.json.cs new file mode 100644 index 000000000000..f640bfcc0318 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueuePropertiesMetadata.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A name-value pair that represents queue metadata. + public partial class QueuePropertiesMetadata + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new QueuePropertiesMetadata(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal QueuePropertiesMetadata(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..91043f99853c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a storage account’s Queue service. + [System.ComponentModel.TypeConverter(typeof(QueueServicePropertiesTypeConverter))] + public partial class QueueServiceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueueServiceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueueServiceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueueServiceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueueServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated) content.GetValueForProperty("QueueServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("QueueServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("QueueServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueueServiceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueueServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated) content.GetValueForProperty("QueueServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("QueueServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("QueueServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).QueueServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a storage account’s Queue service. + [System.ComponentModel.TypeConverter(typeof(QueueServicePropertiesTypeConverter))] + public partial interface IQueueServiceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..ffc94a12fa8b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueueServicePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueueServiceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueueServiceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueueServiceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.cs new file mode 100644 index 000000000000..f444a5757442 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Queue service. + public partial class QueueServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)QueueServiceProperty).CorCorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)QueueServiceProperty).CorCorsRule = value ?? null /* arrayOf */; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for QueueServiceProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal.QueueServiceProperty { get => (this._queueServiceProperty = this._queueServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServicePropertiesAutoGenerated()); set { {_queueServiceProperty = value;} } } + + /// Internal Acessors for QueueServicePropertyCor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesInternal.QueueServicePropertyCor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)QueueServiceProperty).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)QueueServiceProperty).Cor = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated _queueServiceProperty; + + /// The properties of a storage account’s Queue service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated QueueServiceProperty { get => (this._queueServiceProperty = this._queueServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServicePropertiesAutoGenerated()); set => this._queueServiceProperty = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public QueueServiceProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The properties of a storage account’s Queue service. + public partial interface IQueueServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + + } + /// The properties of a storage account’s Queue service. + internal partial interface IQueueServicePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// The properties of a storage account’s Queue service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated QueueServiceProperty { get; set; } + /// + /// Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules QueueServicePropertyCor { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.json.cs new file mode 100644 index 000000000000..887dce79135b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServiceProperties.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Queue service. + public partial class QueueServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new QueueServiceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal QueueServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_queueServiceProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServicePropertiesAutoGenerated.FromJson(__jsonProperties) : QueueServiceProperty;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._queueServiceProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._queueServiceProperty.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..e2c83558f0db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a storage account’s Queue service. + [System.ComponentModel.TypeConverter(typeof(QueueServicePropertiesAutoGeneratedTypeConverter))] + public partial class QueueServicePropertiesAutoGenerated + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new QueueServicePropertiesAutoGenerated(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new QueueServicePropertiesAutoGenerated(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal QueueServicePropertiesAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal QueueServicePropertiesAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a storage account’s Queue service. + [System.ComponentModel.TypeConverter(typeof(QueueServicePropertiesAutoGeneratedTypeConverter))] + public partial interface IQueueServicePropertiesAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..8e3cd5d8b2ae --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class QueueServicePropertiesAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return QueueServicePropertiesAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return QueueServicePropertiesAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return QueueServicePropertiesAutoGenerated.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..e7a1ce1e9aae --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Queue service. + public partial class QueueServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules _cor; + + /// + /// Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set => this._cor = value; } + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set { {_cor = value;} } } + + /// Creates an new instance. + public QueueServicePropertiesAutoGenerated() + { + + } + } + /// The properties of a storage account’s Queue service. + public partial interface IQueueServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + + } + /// The properties of a storage account’s Queue service. + internal partial interface IQueueServicePropertiesAutoGeneratedInternal + + { + /// + /// Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get; set; } + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..829299ca777b --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/QueueServicePropertiesAutoGenerated.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Queue service. + public partial class QueueServicePropertiesAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServicePropertiesAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new QueueServicePropertiesAutoGenerated(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal QueueServicePropertiesAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cor = If( json?.PropertyT("cors"), out var __jsonCors) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules.FromJson(__jsonCors) : Cor;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._cor ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._cor.ToJson(null,serializationMode) : null, "cors" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.PowerShell.cs new file mode 100644 index 000000000000..112661115253 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Resource Access Rule. + [System.ComponentModel.TypeConverter(typeof(ResourceAccessRuleTypeConverter))] + public partial class ResourceAccessRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ResourceAccessRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ResourceAccessRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ResourceAccessRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).ResourceId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ResourceAccessRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("ResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).ResourceId = (string) content.GetValueForProperty("ResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal)this).ResourceId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Resource Access Rule. + [System.ComponentModel.TypeConverter(typeof(ResourceAccessRuleTypeConverter))] + public partial interface IResourceAccessRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.TypeConverter.cs new file mode 100644 index 000000000000..0885b43f0310 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ResourceAccessRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ResourceAccessRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ResourceAccessRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ResourceAccessRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.cs b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.cs new file mode 100644 index 000000000000..1bab971c0dd4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Resource Access Rule. + public partial class ResourceAccessRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRuleInternal + { + + /// Backing field for property. + private string _resourceId; + + /// Resource Id + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ResourceId { get => this._resourceId; set => this._resourceId = value; } + + /// Backing field for property. + private string _tenantId; + + /// Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; set => this._tenantId = value; } + + /// Creates an new instance. + public ResourceAccessRule() + { + + } + } + /// Resource Access Rule. + public partial interface IResourceAccessRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Resource Id + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource Id", + SerializedName = @"resourceId", + PossibleTypes = new [] { typeof(string) })] + string ResourceId { get; set; } + /// Tenant Id + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Tenant Id", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; set; } + + } + /// Resource Access Rule. + internal partial interface IResourceAccessRuleInternal + + { + /// Resource Id + string ResourceId { get; set; } + /// Tenant Id + string TenantId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.json.cs new file mode 100644 index 000000000000..259d589400c0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ResourceAccessRule.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Resource Access Rule. + public partial class ResourceAccessRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ResourceAccessRule(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ResourceAccessRule(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_resourceId = If( json?.PropertyT("resourceId"), out var __jsonResourceId) ? (string)__jsonResourceId : (string)ResourceId;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + AddIf( null != (((object)this._resourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resourceId.ToString()) : null, "resourceId" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.PowerShell.cs new file mode 100644 index 000000000000..412d4d50b1a1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The blob service properties for blob restore policy + [System.ComponentModel.TypeConverter(typeof(RestorePolicyPropertiesTypeConverter))] + public partial class RestorePolicyProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RestorePolicyProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RestorePolicyProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RestorePolicyProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).LastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MinRestoreTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).MinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("MinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).MinRestoreTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RestorePolicyProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Enabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Enabled = (bool) content.GetValueForProperty("Enabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Enabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("Day")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Day = (int?) content.GetValueForProperty("Day",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).Day, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("LastEnabledTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).LastEnabledTime = (global::System.DateTime?) content.GetValueForProperty("LastEnabledTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).LastEnabledTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("MinRestoreTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).MinRestoreTime = (global::System.DateTime?) content.GetValueForProperty("MinRestoreTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal)this).MinRestoreTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The blob service properties for blob restore policy + [System.ComponentModel.TypeConverter(typeof(RestorePolicyPropertiesTypeConverter))] + public partial interface IRestorePolicyProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.TypeConverter.cs new file mode 100644 index 000000000000..125bc38a3266 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RestorePolicyPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RestorePolicyProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RestorePolicyProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RestorePolicyProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.cs new file mode 100644 index 000000000000..61a4c9c32722 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob service properties for blob restore policy + public partial class RestorePolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal + { + + /// Backing field for property. + private int? _day; + + /// + /// how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? Day { get => this._day; set => this._day = value; } + + /// Backing field for property. + private bool _enabled; + + /// Blob restore is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool Enabled { get => this._enabled; set => this._enabled = value; } + + /// Backing field for property. + private global::System.DateTime? _lastEnabledTime; + + /// Deprecated in favor of minRestoreTime property. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastEnabledTime { get => this._lastEnabledTime; } + + /// Internal Acessors for LastEnabledTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal.LastEnabledTime { get => this._lastEnabledTime; set { {_lastEnabledTime = value;} } } + + /// Internal Acessors for MinRestoreTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyPropertiesInternal.MinRestoreTime { get => this._minRestoreTime; set { {_minRestoreTime = value;} } } + + /// Backing field for property. + private global::System.DateTime? _minRestoreTime; + + /// Returns the minimum date and time that the restore can be started. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? MinRestoreTime { get => this._minRestoreTime; } + + /// Creates an new instance. + public RestorePolicyProperties() + { + + } + } + /// The blob service properties for blob restore policy + public partial interface IRestorePolicyProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days.", + SerializedName = @"days", + PossibleTypes = new [] { typeof(int) })] + int? Day { get; set; } + /// Blob restore is enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob restore is enabled if set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool Enabled { get; set; } + /// Deprecated in favor of minRestoreTime property. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Deprecated in favor of minRestoreTime property.", + SerializedName = @"lastEnabledTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastEnabledTime { get; } + /// Returns the minimum date and time that the restore can be started. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the minimum date and time that the restore can be started.", + SerializedName = @"minRestoreTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? MinRestoreTime { get; } + + } + /// The blob service properties for blob restore policy + internal partial interface IRestorePolicyPropertiesInternal + + { + /// + /// how long this blob can be restored. It should be great than zero and less than DeleteRetentionPolicy.days. + /// + int? Day { get; set; } + /// Blob restore is enabled if set to true. + bool Enabled { get; set; } + /// Deprecated in favor of minRestoreTime property. + global::System.DateTime? LastEnabledTime { get; set; } + /// Returns the minimum date and time that the restore can be started. + global::System.DateTime? MinRestoreTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.json.cs new file mode 100644 index 000000000000..52c98d3210b7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RestorePolicyProperties.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The blob service properties for blob restore policy + public partial class RestorePolicyProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestorePolicyProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new RestorePolicyProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal RestorePolicyProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_enabled = If( json?.PropertyT("enabled"), out var __jsonEnabled) ? (bool)__jsonEnabled : Enabled;} + {_day = If( json?.PropertyT("days"), out var __jsonDays) ? (int?)__jsonDays : Day;} + {_lastEnabledTime = If( json?.PropertyT("lastEnabledTime"), out var __jsonLastEnabledTime) ? global::System.DateTime.TryParse((string)__jsonLastEnabledTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastEnabledTimeValue) ? __jsonLastEnabledTimeValue : LastEnabledTime : LastEnabledTime;} + {_minRestoreTime = If( json?.PropertyT("minRestoreTime"), out var __jsonMinRestoreTime) ? global::System.DateTime.TryParse((string)__jsonMinRestoreTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonMinRestoreTimeValue) ? __jsonMinRestoreTimeValue : MinRestoreTime : MinRestoreTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean(this._enabled), "enabled" ,container.Add ); + AddIf( null != this._day ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._day) : null, "days" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastEnabledTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastEnabledTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastEnabledTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._minRestoreTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._minRestoreTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "minRestoreTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Restriction.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.PowerShell.cs new file mode 100644 index 000000000000..39e0db08a563 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The restriction because of which SKU cannot be used. + [System.ComponentModel.TypeConverter(typeof(RestrictionTypeConverter))] + public partial class Restriction + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Restriction(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Restriction(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Restriction(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ReasonCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).ReasonCode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode?) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).ReasonCode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Restriction(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Value = (string[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("ReasonCode")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).ReasonCode = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode?) content.GetValueForProperty("ReasonCode",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal)this).ReasonCode, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The restriction because of which SKU cannot be used. + [System.ComponentModel.TypeConverter(typeof(RestrictionTypeConverter))] + public partial interface IRestriction + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Restriction.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.TypeConverter.cs new file mode 100644 index 000000000000..c786e0ab35ba --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RestrictionTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Restriction.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Restriction.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Restriction.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Restriction.cs b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.cs new file mode 100644 index 000000000000..f8e7420ab8bd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The restriction because of which SKU cannot be used. + public partial class Restriction : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal + { + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal.Type { get => this._type; set { {_type = value;} } } + + /// Internal Acessors for Value + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestrictionInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode? _reasonCode; + + /// + /// The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when + /// the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" + /// is related to capacity at DC. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode? ReasonCode { get => this._reasonCode; set => this._reasonCode = value; } + + /// Backing field for property. + private string _type; + + /// The type of restrictions. As of now only possible value for this is location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// Backing field for property. + private string[] _value; + + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] Value { get => this._value; } + + /// Creates an new instance. + public Restriction() + { + + } + } + /// The restriction because of which SKU cannot be used. + public partial interface IRestriction : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when + /// the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" + /// is related to capacity at DC. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The reason for the restriction. As of now this can be ""QuotaId"" or ""NotAvailableForSubscription"". Quota Id is set when the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The ""NotAvailableForSubscription"" is related to capacity at DC.", + SerializedName = @"reasonCode", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode? ReasonCode { get; set; } + /// The type of restrictions. As of now only possible value for this is location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of restrictions. As of now only possible value for this is location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted.", + SerializedName = @"values", + PossibleTypes = new [] { typeof(string) })] + string[] Value { get; } + + } + /// The restriction because of which SKU cannot be used. + internal partial interface IRestrictionInternal + + { + /// + /// The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when + /// the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" + /// is related to capacity at DC. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode? ReasonCode { get; set; } + /// The type of restrictions. As of now only possible value for this is location. + string Type { get; set; } + /// + /// The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU + /// is restricted. + /// + string[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Restriction.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.json.cs new file mode 100644 index 000000000000..4970c3650cdd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Restriction.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The restriction because of which SKU cannot be used. + public partial class Restriction + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Restriction(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Restriction(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + {_value = If( json?.PropertyT("values"), out var __jsonValues) ? If( __jsonValues as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Value;} + {_reasonCode = If( json?.PropertyT("reasonCode"), out var __jsonReasonCode) ? (string)__jsonReasonCode : (string)ReasonCode;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("values",__w); + } + } + AddIf( null != (((object)this._reasonCode)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._reasonCode.ToString()) : null, "reasonCode" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.PowerShell.cs new file mode 100644 index 000000000000..ff9a1a89d78f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.PowerShell.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, + /// the default option is microsoft routing + /// + [System.ComponentModel.TypeConverter(typeof(RoutingPreferenceTypeConverter))] + public partial class RoutingPreference + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new RoutingPreference(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new RoutingPreference(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal RoutingPreference(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).RoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).RoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("PublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("PublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishInternetEndpoint = (bool?) content.GetValueForProperty("PublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal RoutingPreference(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("RoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).RoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).RoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("PublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("PublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishInternetEndpoint = (bool?) content.GetValueForProperty("PublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)this).PublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, + /// the default option is microsoft routing + [System.ComponentModel.TypeConverter(typeof(RoutingPreferenceTypeConverter))] + public partial interface IRoutingPreference + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.TypeConverter.cs new file mode 100644 index 000000000000..cf50cfb9c3fa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class RoutingPreferenceTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return RoutingPreference.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return RoutingPreference.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return RoutingPreference.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.cs b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.cs new file mode 100644 index 000000000000..c9ca2a4b09fc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, + /// the default option is microsoft routing + /// + public partial class RoutingPreference : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal + { + + /// Backing field for property. + private bool? _publishInternetEndpoint; + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? PublishInternetEndpoint { get => this._publishInternetEndpoint; set => this._publishInternetEndpoint = value; } + + /// Backing field for property. + private bool? _publishMicrosoftEndpoint; + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? PublishMicrosoftEndpoint { get => this._publishMicrosoftEndpoint; set => this._publishMicrosoftEndpoint = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? _routingChoice; + + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingChoice { get => this._routingChoice; set => this._routingChoice = value; } + + /// Creates an new instance. + public RoutingPreference() + { + + } + } + /// Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, + /// the default option is microsoft routing + public partial interface IRoutingPreference : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? PublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? PublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingChoice { get; set; } + + } + /// Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, + /// the default option is microsoft routing + internal partial interface IRoutingPreferenceInternal + + { + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + bool? PublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + bool? PublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingChoice { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.json.cs new file mode 100644 index 000000000000..e2e2010cf98e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/RoutingPreference.json.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Routing preference defines the type of network, either microsoft or internet routing to be used to deliver the user data, + /// the default option is microsoft routing + /// + public partial class RoutingPreference + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new RoutingPreference(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal RoutingPreference(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_routingChoice = If( json?.PropertyT("routingChoice"), out var __jsonRoutingChoice) ? (string)__jsonRoutingChoice : (string)RoutingChoice;} + {_publishMicrosoftEndpoint = If( json?.PropertyT("publishMicrosoftEndpoints"), out var __jsonPublishMicrosoftEndpoints) ? (bool?)__jsonPublishMicrosoftEndpoints : PublishMicrosoftEndpoint;} + {_publishInternetEndpoint = If( json?.PropertyT("publishInternetEndpoints"), out var __jsonPublishInternetEndpoints) ? (bool?)__jsonPublishInternetEndpoints : PublishInternetEndpoint;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._routingChoice)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._routingChoice.ToString()) : null, "routingChoice" ,container.Add ); + AddIf( null != this._publishMicrosoftEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._publishMicrosoftEndpoint) : null, "publishMicrosoftEndpoints" ,container.Add ); + AddIf( null != this._publishInternetEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._publishInternetEndpoint) : null, "publishInternetEndpoints" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.PowerShell.cs new file mode 100644 index 000000000000..7be62fefa520 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// SasPolicy assigned to the storage account. + [System.ComponentModel.TypeConverter(typeof(SasPolicyTypeConverter))] + public partial class SasPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SasPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SasPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SasPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).SasExpirationPeriod = (string) content.GetValueForProperty("SasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).SasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("ExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).ExpirationAction = (string) content.GetValueForProperty("ExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).ExpirationAction, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SasPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).SasExpirationPeriod = (string) content.GetValueForProperty("SasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).SasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("ExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).ExpirationAction = (string) content.GetValueForProperty("ExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)this).ExpirationAction, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// SasPolicy assigned to the storage account. + [System.ComponentModel.TypeConverter(typeof(SasPolicyTypeConverter))] + public partial interface ISasPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.TypeConverter.cs new file mode 100644 index 000000000000..21991507a577 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SasPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SasPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SasPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SasPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.cs new file mode 100644 index 000000000000..23da720a25e8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// SasPolicy assigned to the storage account. + public partial class SasPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal + { + + /// Backing field for property. + private string _expirationAction= @"Log"; + + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ExpirationAction { get => this._expirationAction; } + + /// Internal Acessors for ExpirationAction + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal.ExpirationAction { get => this._expirationAction; set { {_expirationAction = value;} } } + + /// Backing field for property. + private string _sasExpirationPeriod; + + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SasExpirationPeriod { get => this._sasExpirationPeriod; set => this._sasExpirationPeriod = value; } + + /// Creates an new instance. + public SasPolicy() + { + + } + } + /// SasPolicy assigned to the storage account. + public partial interface ISasPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The SAS expiration action. Can only be Log.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(string) })] + string ExpirationAction { get; } + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + string SasExpirationPeriod { get; set; } + + } + /// SasPolicy assigned to the storage account. + internal partial interface ISasPolicyInternal + + { + /// The SAS expiration action. Can only be Log. + string ExpirationAction { get; set; } + /// The SAS expiration period, DD.HH:MM:SS. + string SasExpirationPeriod { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.json.cs new file mode 100644 index 000000000000..e19a479b010c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SasPolicy.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// SasPolicy assigned to the storage account. + public partial class SasPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new SasPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal SasPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sasExpirationPeriod = If( json?.PropertyT("sasExpirationPeriod"), out var __jsonSasExpirationPeriod) ? (string)__jsonSasExpirationPeriod : (string)SasExpirationPeriod;} + {_expirationAction = If( json?.PropertyT("expirationAction"), out var __jsonExpirationAction) ? (string)__jsonExpirationAction : (string)ExpirationAction;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._sasExpirationPeriod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sasExpirationPeriod.ToString()) : null, "sasExpirationPeriod" ,container.Add ); + AddIf( null != (((object)this._expirationAction)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._expirationAction.ToString()) : null, "expirationAction" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.PowerShell.cs new file mode 100644 index 000000000000..6ebfca089147 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.PowerShell.cs @@ -0,0 +1,280 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The parameters to list service SAS credentials of a specific resource. + [System.ComponentModel.TypeConverter(typeof(ServiceSasParametersTypeConverter))] + public partial class ServiceSasParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceSasParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceSasParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceSasParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CanonicalizedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CanonicalizedResource = (string) content.GetValueForProperty("CanonicalizedResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CanonicalizedResource, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource?) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SharedAccessExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Identifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Identifier = (string) content.GetValueForProperty("Identifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Identifier, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyStart = (string) content.GetValueForProperty("PartitionKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyStart, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyEnd = (string) content.GetValueForProperty("PartitionKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("RowKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyStart = (string) content.GetValueForProperty("RowKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyStart, global::System.Convert.ToString); + } + if (content.Contains("RowKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyEnd = (string) content.GetValueForProperty("RowKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("KeyToSign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).KeyToSign, global::System.Convert.ToString); + } + if (content.Contains("CacheControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CacheControl = (string) content.GetValueForProperty("CacheControl",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CacheControl, global::System.Convert.ToString); + } + if (content.Contains("ContentDisposition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentDisposition = (string) content.GetValueForProperty("ContentDisposition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentDisposition, global::System.Convert.ToString); + } + if (content.Contains("ContentEncoding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentEncoding = (string) content.GetValueForProperty("ContentEncoding",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentEncoding, global::System.Convert.ToString); + } + if (content.Contains("ContentLanguage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentLanguage = (string) content.GetValueForProperty("ContentLanguage",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentLanguage, global::System.Convert.ToString); + } + if (content.Contains("ContentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentType, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceSasParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CanonicalizedResource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CanonicalizedResource = (string) content.GetValueForProperty("CanonicalizedResource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CanonicalizedResource, global::System.Convert.ToString); + } + if (content.Contains("Resource")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Resource = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource?) content.GetValueForProperty("Resource",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Resource, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource.CreateFrom); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions.CreateFrom); + } + if (content.Contains("IPAddressOrRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).IPAddressOrRange = (string) content.GetValueForProperty("IPAddressOrRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).IPAddressOrRange, global::System.Convert.ToString); + } + if (content.Contains("Protocol")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Protocol = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol?) content.GetValueForProperty("Protocol",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Protocol, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol.CreateFrom); + } + if (content.Contains("SharedAccessStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessStartTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SharedAccessExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessExpiryTime = (global::System.DateTime?) content.GetValueForProperty("SharedAccessExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).SharedAccessExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Identifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Identifier = (string) content.GetValueForProperty("Identifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).Identifier, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyStart = (string) content.GetValueForProperty("PartitionKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyStart, global::System.Convert.ToString); + } + if (content.Contains("PartitionKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyEnd = (string) content.GetValueForProperty("PartitionKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).PartitionKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("RowKeyStart")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyStart = (string) content.GetValueForProperty("RowKeyStart",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyStart, global::System.Convert.ToString); + } + if (content.Contains("RowKeyEnd")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyEnd = (string) content.GetValueForProperty("RowKeyEnd",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).RowKeyEnd, global::System.Convert.ToString); + } + if (content.Contains("KeyToSign")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).KeyToSign = (string) content.GetValueForProperty("KeyToSign",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).KeyToSign, global::System.Convert.ToString); + } + if (content.Contains("CacheControl")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CacheControl = (string) content.GetValueForProperty("CacheControl",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).CacheControl, global::System.Convert.ToString); + } + if (content.Contains("ContentDisposition")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentDisposition = (string) content.GetValueForProperty("ContentDisposition",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentDisposition, global::System.Convert.ToString); + } + if (content.Contains("ContentEncoding")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentEncoding = (string) content.GetValueForProperty("ContentEncoding",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentEncoding, global::System.Convert.ToString); + } + if (content.Contains("ContentLanguage")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentLanguage = (string) content.GetValueForProperty("ContentLanguage",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentLanguage, global::System.Convert.ToString); + } + if (content.Contains("ContentType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentType = (string) content.GetValueForProperty("ContentType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal)this).ContentType, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters to list service SAS credentials of a specific resource. + [System.ComponentModel.TypeConverter(typeof(ServiceSasParametersTypeConverter))] + public partial interface IServiceSasParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.TypeConverter.cs new file mode 100644 index 000000000000..b40f7a2fd42a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceSasParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceSasParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceSasParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceSasParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.cs new file mode 100644 index 000000000000..80e197248243 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.cs @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters to list service SAS credentials of a specific resource. + public partial class ServiceSasParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParametersInternal + { + + /// Backing field for property. + private string _cacheControl; + + /// The response header override for cache control. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string CacheControl { get => this._cacheControl; set => this._cacheControl = value; } + + /// Backing field for property. + private string _canonicalizedResource; + + /// The canonical path to the signed resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string CanonicalizedResource { get => this._canonicalizedResource; set => this._canonicalizedResource = value; } + + /// Backing field for property. + private string _contentDisposition; + + /// The response header override for content disposition. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ContentDisposition { get => this._contentDisposition; set => this._contentDisposition = value; } + + /// Backing field for property. + private string _contentEncoding; + + /// The response header override for content encoding. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ContentEncoding { get => this._contentEncoding; set => this._contentEncoding = value; } + + /// Backing field for property. + private string _contentLanguage; + + /// The response header override for content language. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ContentLanguage { get => this._contentLanguage; set => this._contentLanguage = value; } + + /// Backing field for property. + private string _contentType; + + /// The response header override for content type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ContentType { get => this._contentType; set => this._contentType = value; } + + /// Backing field for property. + private string _iPAddressOrRange; + + /// An IP address or a range of IP addresses from which to accept requests. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string IPAddressOrRange { get => this._iPAddressOrRange; set => this._iPAddressOrRange = value; } + + /// Backing field for property. + private string _identifier; + + /// + /// A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or + /// table. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Identifier { get => this._identifier; set => this._identifier = value; } + + /// Backing field for property. + private string _keyToSign; + + /// The key to sign the account SAS token with. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyToSign { get => this._keyToSign; set => this._keyToSign = value; } + + /// Backing field for property. + private string _partitionKeyEnd; + + /// The end of partition key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PartitionKeyEnd { get => this._partitionKeyEnd; set => this._partitionKeyEnd = value; } + + /// Backing field for property. + private string _partitionKeyStart; + + /// The start of partition key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PartitionKeyStart { get => this._partitionKeyStart; set => this._partitionKeyStart = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions? _permission; + + /// + /// The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions? Permission { get => this._permission; set => this._permission = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? _protocol; + + /// The protocol permitted for a request made with the account SAS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? Protocol { get => this._protocol; set => this._protocol = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource? _resource; + + /// + /// The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share + /// (s). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource? Resource { get => this._resource; set => this._resource = value; } + + /// Backing field for property. + private string _rowKeyEnd; + + /// The end of row key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string RowKeyEnd { get => this._rowKeyEnd; set => this._rowKeyEnd = value; } + + /// Backing field for property. + private string _rowKeyStart; + + /// The start of row key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string RowKeyStart { get => this._rowKeyStart; set => this._rowKeyStart = value; } + + /// Backing field for property. + private global::System.DateTime? _sharedAccessExpiryTime; + + /// The time at which the shared access signature becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? SharedAccessExpiryTime { get => this._sharedAccessExpiryTime; set => this._sharedAccessExpiryTime = value; } + + /// Backing field for property. + private global::System.DateTime? _sharedAccessStartTime; + + /// The time at which the SAS becomes valid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? SharedAccessStartTime { get => this._sharedAccessStartTime; set => this._sharedAccessStartTime = value; } + + /// Creates an new instance. + public ServiceSasParameters() + { + + } + } + /// The parameters to list service SAS credentials of a specific resource. + public partial interface IServiceSasParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The response header override for cache control. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for cache control.", + SerializedName = @"rscc", + PossibleTypes = new [] { typeof(string) })] + string CacheControl { get; set; } + /// The canonical path to the signed resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The canonical path to the signed resource.", + SerializedName = @"canonicalizedResource", + PossibleTypes = new [] { typeof(string) })] + string CanonicalizedResource { get; set; } + /// The response header override for content disposition. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content disposition.", + SerializedName = @"rscd", + PossibleTypes = new [] { typeof(string) })] + string ContentDisposition { get; set; } + /// The response header override for content encoding. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content encoding.", + SerializedName = @"rsce", + PossibleTypes = new [] { typeof(string) })] + string ContentEncoding { get; set; } + /// The response header override for content language. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content language.", + SerializedName = @"rscl", + PossibleTypes = new [] { typeof(string) })] + string ContentLanguage { get; set; } + /// The response header override for content type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content type.", + SerializedName = @"rsct", + PossibleTypes = new [] { typeof(string) })] + string ContentType { get; set; } + /// An IP address or a range of IP addresses from which to accept requests. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An IP address or a range of IP addresses from which to accept requests.", + SerializedName = @"signedIp", + PossibleTypes = new [] { typeof(string) })] + string IPAddressOrRange { get; set; } + /// + /// A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or + /// table. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table.", + SerializedName = @"signedIdentifier", + PossibleTypes = new [] { typeof(string) })] + string Identifier { get; set; } + /// The key to sign the account SAS token with. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key to sign the account SAS token with.", + SerializedName = @"keyToSign", + PossibleTypes = new [] { typeof(string) })] + string KeyToSign { get; set; } + /// The end of partition key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end of partition key.", + SerializedName = @"endPk", + PossibleTypes = new [] { typeof(string) })] + string PartitionKeyEnd { get; set; } + /// The start of partition key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start of partition key.", + SerializedName = @"startPk", + PossibleTypes = new [] { typeof(string) })] + string PartitionKeyStart { get; set; } + /// + /// The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).", + SerializedName = @"signedPermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions? Permission { get; set; } + /// The protocol permitted for a request made with the account SAS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The protocol permitted for a request made with the account SAS.", + SerializedName = @"signedProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? Protocol { get; set; } + /// + /// The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share + /// (s). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s).", + SerializedName = @"signedResource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource? Resource { get; set; } + /// The end of row key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end of row key.", + SerializedName = @"endRk", + PossibleTypes = new [] { typeof(string) })] + string RowKeyEnd { get; set; } + /// The start of row key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start of row key.", + SerializedName = @"startRk", + PossibleTypes = new [] { typeof(string) })] + string RowKeyStart { get; set; } + /// The time at which the shared access signature becomes invalid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which the shared access signature becomes invalid.", + SerializedName = @"signedExpiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SharedAccessExpiryTime { get; set; } + /// The time at which the SAS becomes valid. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which the SAS becomes valid.", + SerializedName = @"signedStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? SharedAccessStartTime { get; set; } + + } + /// The parameters to list service SAS credentials of a specific resource. + internal partial interface IServiceSasParametersInternal + + { + /// The response header override for cache control. + string CacheControl { get; set; } + /// The canonical path to the signed resource. + string CanonicalizedResource { get; set; } + /// The response header override for content disposition. + string ContentDisposition { get; set; } + /// The response header override for content encoding. + string ContentEncoding { get; set; } + /// The response header override for content language. + string ContentLanguage { get; set; } + /// The response header override for content type. + string ContentType { get; set; } + /// An IP address or a range of IP addresses from which to accept requests. + string IPAddressOrRange { get; set; } + /// + /// A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or + /// table. + /// + string Identifier { get; set; } + /// The key to sign the account SAS token with. + string KeyToSign { get; set; } + /// The end of partition key. + string PartitionKeyEnd { get; set; } + /// The start of partition key. + string PartitionKeyStart { get; set; } + /// + /// The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions? Permission { get; set; } + /// The protocol permitted for a request made with the account SAS. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol? Protocol { get; set; } + /// + /// The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share + /// (s). + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource? Resource { get; set; } + /// The end of row key. + string RowKeyEnd { get; set; } + /// The start of row key. + string RowKeyStart { get; set; } + /// The time at which the shared access signature becomes invalid. + global::System.DateTime? SharedAccessExpiryTime { get; set; } + /// The time at which the SAS becomes valid. + global::System.DateTime? SharedAccessStartTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.json.cs new file mode 100644 index 000000000000..b50d01af3950 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSasParameters.json.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters to list service SAS credentials of a specific resource. + public partial class ServiceSasParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ServiceSasParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceSasParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_canonicalizedResource = If( json?.PropertyT("canonicalizedResource"), out var __jsonCanonicalizedResource) ? (string)__jsonCanonicalizedResource : (string)CanonicalizedResource;} + {_resource = If( json?.PropertyT("signedResource"), out var __jsonSignedResource) ? (string)__jsonSignedResource : (string)Resource;} + {_permission = If( json?.PropertyT("signedPermission"), out var __jsonSignedPermission) ? (string)__jsonSignedPermission : (string)Permission;} + {_iPAddressOrRange = If( json?.PropertyT("signedIp"), out var __jsonSignedIP) ? (string)__jsonSignedIP : (string)IPAddressOrRange;} + {_protocol = If( json?.PropertyT("signedProtocol"), out var __jsonSignedProtocol) ? (string)__jsonSignedProtocol : (string)Protocol;} + {_sharedAccessStartTime = If( json?.PropertyT("signedStart"), out var __jsonSignedStart) ? global::System.DateTime.TryParse((string)__jsonSignedStart, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSignedStartValue) ? __jsonSignedStartValue : SharedAccessStartTime : SharedAccessStartTime;} + {_sharedAccessExpiryTime = If( json?.PropertyT("signedExpiry"), out var __jsonSignedExpiry) ? global::System.DateTime.TryParse((string)__jsonSignedExpiry, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonSignedExpiryValue) ? __jsonSignedExpiryValue : SharedAccessExpiryTime : SharedAccessExpiryTime;} + {_identifier = If( json?.PropertyT("signedIdentifier"), out var __jsonSignedIdentifier) ? (string)__jsonSignedIdentifier : (string)Identifier;} + {_partitionKeyStart = If( json?.PropertyT("startPk"), out var __jsonStartPk) ? (string)__jsonStartPk : (string)PartitionKeyStart;} + {_partitionKeyEnd = If( json?.PropertyT("endPk"), out var __jsonEndPk) ? (string)__jsonEndPk : (string)PartitionKeyEnd;} + {_rowKeyStart = If( json?.PropertyT("startRk"), out var __jsonStartRk) ? (string)__jsonStartRk : (string)RowKeyStart;} + {_rowKeyEnd = If( json?.PropertyT("endRk"), out var __jsonEndRk) ? (string)__jsonEndRk : (string)RowKeyEnd;} + {_keyToSign = If( json?.PropertyT("keyToSign"), out var __jsonKeyToSign) ? (string)__jsonKeyToSign : (string)KeyToSign;} + {_cacheControl = If( json?.PropertyT("rscc"), out var __jsonRscc) ? (string)__jsonRscc : (string)CacheControl;} + {_contentDisposition = If( json?.PropertyT("rscd"), out var __jsonRscd) ? (string)__jsonRscd : (string)ContentDisposition;} + {_contentEncoding = If( json?.PropertyT("rsce"), out var __jsonRsce) ? (string)__jsonRsce : (string)ContentEncoding;} + {_contentLanguage = If( json?.PropertyT("rscl"), out var __jsonRscl) ? (string)__jsonRscl : (string)ContentLanguage;} + {_contentType = If( json?.PropertyT("rsct"), out var __jsonRsct) ? (string)__jsonRsct : (string)ContentType;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._canonicalizedResource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._canonicalizedResource.ToString()) : null, "canonicalizedResource" ,container.Add ); + AddIf( null != (((object)this._resource)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resource.ToString()) : null, "signedResource" ,container.Add ); + AddIf( null != (((object)this._permission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._permission.ToString()) : null, "signedPermission" ,container.Add ); + AddIf( null != (((object)this._iPAddressOrRange)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._iPAddressOrRange.ToString()) : null, "signedIp" ,container.Add ); + AddIf( null != (((object)this._protocol)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._protocol.ToString()) : null, "signedProtocol" ,container.Add ); + AddIf( null != this._sharedAccessStartTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sharedAccessStartTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "signedStart" ,container.Add ); + AddIf( null != this._sharedAccessExpiryTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._sharedAccessExpiryTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "signedExpiry" ,container.Add ); + AddIf( null != (((object)this._identifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._identifier.ToString()) : null, "signedIdentifier" ,container.Add ); + AddIf( null != (((object)this._partitionKeyStart)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._partitionKeyStart.ToString()) : null, "startPk" ,container.Add ); + AddIf( null != (((object)this._partitionKeyEnd)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._partitionKeyEnd.ToString()) : null, "endPk" ,container.Add ); + AddIf( null != (((object)this._rowKeyStart)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._rowKeyStart.ToString()) : null, "startRk" ,container.Add ); + AddIf( null != (((object)this._rowKeyEnd)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._rowKeyEnd.ToString()) : null, "endRk" ,container.Add ); + AddIf( null != (((object)this._keyToSign)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyToSign.ToString()) : null, "keyToSign" ,container.Add ); + AddIf( null != (((object)this._cacheControl)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._cacheControl.ToString()) : null, "rscc" ,container.Add ); + AddIf( null != (((object)this._contentDisposition)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._contentDisposition.ToString()) : null, "rscd" ,container.Add ); + AddIf( null != (((object)this._contentEncoding)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._contentEncoding.ToString()) : null, "rsce" ,container.Add ); + AddIf( null != (((object)this._contentLanguage)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._contentLanguage.ToString()) : null, "rscl" ,container.Add ); + AddIf( null != (((object)this._contentType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._contentType.ToString()) : null, "rsct" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.PowerShell.cs new file mode 100644 index 000000000000..0c2f073c9486 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// One property of operation, include metric specifications. + [System.ComponentModel.TypeConverter(typeof(ServiceSpecificationTypeConverter))] + public partial class ServiceSpecification + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new ServiceSpecification(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new ServiceSpecification(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal ServiceSpecification(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecificationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal ServiceSpecification(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("MetricSpecification")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecificationInternal)this).MetricSpecification = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[]) content.GetValueForProperty("MetricSpecification",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecificationInternal)this).MetricSpecification, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecificationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// One property of operation, include metric specifications. + [System.ComponentModel.TypeConverter(typeof(ServiceSpecificationTypeConverter))] + public partial interface IServiceSpecification + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.TypeConverter.cs new file mode 100644 index 000000000000..d5a759411cff --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class ServiceSpecificationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return ServiceSpecification.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return ServiceSpecification.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return ServiceSpecification.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.cs new file mode 100644 index 000000000000..4792c3e854f1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// One property of operation, include metric specifications. + public partial class ServiceSpecification : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecificationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] _metricSpecification; + + /// Metric specifications of operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] MetricSpecification { get => this._metricSpecification; set => this._metricSpecification = value; } + + /// Creates an new instance. + public ServiceSpecification() + { + + } + } + /// One property of operation, include metric specifications. + public partial interface IServiceSpecification : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Metric specifications of operation. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Metric specifications of operation.", + SerializedName = @"metricSpecifications", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] MetricSpecification { get; set; } + + } + /// One property of operation, include metric specifications. + internal partial interface IServiceSpecificationInternal + + { + /// Metric specifications of operation. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification[] MetricSpecification { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.json.cs new file mode 100644 index 000000000000..4f4b1aa88c33 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/ServiceSpecification.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// One property of operation, include metric specifications. + public partial class ServiceSpecification + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSpecification FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new ServiceSpecification(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal ServiceSpecification(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_metricSpecification = If( json?.PropertyT("metricSpecifications"), out var __jsonMetricSpecifications) ? If( __jsonMetricSpecifications as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMetricSpecification) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MetricSpecification.FromJson(__u) )) ))() : null : MetricSpecification;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._metricSpecification) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._metricSpecification ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("metricSpecifications",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.PowerShell.cs new file mode 100644 index 000000000000..54c8265367fa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.PowerShell.cs @@ -0,0 +1,174 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(SignedIdentifierTypeConverter))] + public partial class SignedIdentifier + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SignedIdentifier(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SignedIdentifier(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SignedIdentifier(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyPermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyPermission, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SignedIdentifier(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyPermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal)this).AccessPolicyPermission, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(SignedIdentifierTypeConverter))] + public partial interface ISignedIdentifier + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.TypeConverter.cs new file mode 100644 index 000000000000..88d076833a1a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SignedIdentifierTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SignedIdentifier.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SignedIdentifier.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SignedIdentifier.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.cs b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.cs new file mode 100644 index 000000000000..ddfec7544ddb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class SignedIdentifier : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy _accessPolicy; + + /// Access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccessPolicy()); set => this._accessPolicy = value; } + + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? AccessPolicyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)AccessPolicy).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)AccessPolicy).ExpiryTime = value ?? default(global::System.DateTime); } + + /// List of abbreviated permissions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string AccessPolicyPermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)AccessPolicy).Permission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)AccessPolicy).Permission = value ?? null; } + + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? AccessPolicyStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)AccessPolicy).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicyInternal)AccessPolicy).StartTime = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _id; + + /// An unique identifier of the stored access policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for AccessPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifierInternal.AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccessPolicy()); set { {_accessPolicy = value;} } } + + /// Creates an new instance. + public SignedIdentifier() + { + + } + } + public partial interface ISignedIdentifier : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of the access policy", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AccessPolicyExpiryTime { get; set; } + /// List of abbreviated permissions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of abbreviated permissions.", + SerializedName = @"permission", + PossibleTypes = new [] { typeof(string) })] + string AccessPolicyPermission { get; set; } + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of the access policy", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AccessPolicyStartTime { get; set; } + /// An unique identifier of the stored access policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An unique identifier of the stored access policy.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + internal partial interface ISignedIdentifierInternal + + { + /// Access policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccessPolicy AccessPolicy { get; set; } + /// Expiry time of the access policy + global::System.DateTime? AccessPolicyExpiryTime { get; set; } + /// List of abbreviated permissions. + string AccessPolicyPermission { get; set; } + /// Start time of the access policy + global::System.DateTime? AccessPolicyStartTime { get; set; } + /// An unique identifier of the stored access policy. + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.json.cs new file mode 100644 index 000000000000..312cf48ee208 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SignedIdentifier.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class SignedIdentifier + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new SignedIdentifier(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal SignedIdentifier(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_accessPolicy = If( json?.PropertyT("accessPolicy"), out var __jsonAccessPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccessPolicy.FromJson(__jsonAccessPolicy) : AccessPolicy;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._accessPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._accessPolicy.ToJson(null,serializationMode) : null, "accessPolicy" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Sku.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Sku.PowerShell.cs new file mode 100644 index 000000000000..8644fb47de1a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Sku.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The SKU of the storage account. + [System.ComponentModel.TypeConverter(typeof(SkuTypeConverter))] + public partial class Sku + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Sku(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Sku(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Sku(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Sku(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The SKU of the storage account. + [System.ComponentModel.TypeConverter(typeof(SkuTypeConverter))] + public partial interface ISku + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Sku.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Sku.TypeConverter.cs new file mode 100644 index 000000000000..f98668501f49 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Sku.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Sku.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Sku.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Sku.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Sku.cs b/swaggerci/storage/generated/api/Models/Api20220501/Sku.cs new file mode 100644 index 000000000000..3e63793c813f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Sku.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The SKU of the storage account. + public partial class Sku : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal + { + + /// Internal Acessors for Tier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal.Tier { get => this._tier; set { {_tier = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName _name; + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? _tier; + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Tier { get => this._tier; } + + /// Creates an new instance. + public Sku() + { + + } + } + /// The SKU of the storage account. + public partial interface ISku : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName Name { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Tier { get; } + + } + /// The SKU of the storage account. + internal partial interface ISkuInternal + + { + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName Name { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Sku.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Sku.json.cs new file mode 100644 index 000000000000..55a25aed1028 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Sku.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The SKU of the storage account. + public partial class Sku + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Sku(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Sku(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.PowerShell.cs new file mode 100644 index 000000000000..a544ddd5e372 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.PowerShell.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + /// + [System.ComponentModel.TypeConverter(typeof(SkuCapabilityTypeConverter))] + public partial class SkuCapability + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SkuCapability(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SkuCapability(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SkuCapability(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SkuCapability(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + [System.ComponentModel.TypeConverter(typeof(SkuCapabilityTypeConverter))] + public partial interface ISkuCapability + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.TypeConverter.cs new file mode 100644 index 000000000000..22b06a2e53c9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuCapabilityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SkuCapability.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SkuCapability.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SkuCapability.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.cs new file mode 100644 index 000000000000..18e37bdfe104 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + /// + public partial class SkuCapability : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal + { + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal.Name { get => this._name; set { {_name = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapabilityInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _name; + + /// + /// The name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change + /// notification, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; } + + /// Backing field for property. + private string _value; + + /// + /// A string value to indicate states of given capability. Possibly 'true' or 'false'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// Creates an new instance. + public SkuCapability() + { + + } + } + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + public partial interface ISkuCapability : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change + /// notification, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; } + /// + /// A string value to indicate states of given capability. Possibly 'true' or 'false'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A string value to indicate states of given capability. Possibly 'true' or 'false'.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + internal partial interface ISkuCapabilityInternal + + { + /// + /// The name of capability, The capability information in the specified SKU, including file encryption, network ACLs, change + /// notification, etc. + /// + string Name { get; set; } + /// + /// A string value to indicate states of given capability. Possibly 'true' or 'false'. + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.json.cs new file mode 100644 index 000000000000..318d686939a4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuCapability.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + /// + public partial class SkuCapability + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new SkuCapability(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal SkuCapability(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.PowerShell.cs new file mode 100644 index 000000000000..a3c6da98fd23 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.PowerShell.cs @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Storage SKU and its properties + [System.ComponentModel.TypeConverter(typeof(SkuInformationTypeConverter))] + public partial class SkuInformation + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SkuInformation(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SkuInformation(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SkuInformation(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuCapabilityTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Restriction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction[]) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Restriction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestrictionTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SkuInformation(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("Tier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Tier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("Tier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Tier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ResourceType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).ResourceType = (string) content.GetValueForProperty("ResourceType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).ResourceType, global::System.Convert.ToString); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Location = (string[]) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Location, __y => TypeConverterExtensions.SelectToArray(__y, global::System.Convert.ToString)); + } + if (content.Contains("Capability")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Capability = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability[]) content.GetValueForProperty("Capability",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Capability, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuCapabilityTypeConverter.ConvertFrom)); + } + if (content.Contains("Restriction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Restriction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction[]) content.GetValueForProperty("Restriction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal)this).Restriction, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RestrictionTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Storage SKU and its properties + [System.ComponentModel.TypeConverter(typeof(SkuInformationTypeConverter))] + public partial interface ISkuInformation + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.TypeConverter.cs new file mode 100644 index 000000000000..44e67281b902 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SkuInformationTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SkuInformation.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SkuInformation.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SkuInformation.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.cs new file mode 100644 index 000000000000..81ed561b1dbc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage SKU and its properties + public partial class SkuInformation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability[] _capability; + + /// + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability[] Capability { get => this._capability; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? _kind; + + /// Indicates the type of storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get => this._kind; } + + /// Backing field for property. + private string[] _location; + + /// + /// The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, + /// East US, Southeast Asia, etc.). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string[] Location { get => this._location; } + + /// Internal Acessors for Capability + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal.Capability { get => this._capability; set { {_capability = value;} } } + + /// Internal Acessors for Kind + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for Location + string[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal.Location { get => this._location; set { {_location = value;} } } + + /// Internal Acessors for ResourceType + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal.ResourceType { get => this._resourceType; set { {_resourceType = value;} } } + + /// Internal Acessors for Tier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformationInternal.Tier { get => this._tier; set { {_tier = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName _name; + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _resourceType; + + /// The type of the resource, usually it is 'storageAccounts'. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ResourceType { get => this._resourceType; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction[] _restriction; + + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction[] Restriction { get => this._restriction; set => this._restriction = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? _tier; + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Tier { get => this._tier; } + + /// Creates an new instance. + public SkuInformation() + { + + } + } + /// Storage SKU and its properties + public partial interface ISkuInformation : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc.", + SerializedName = @"capabilities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability[] Capability { get; } + /// Indicates the type of storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Indicates the type of storage account.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get; } + /// + /// The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, + /// East US, Southeast Asia, etc.). + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.).", + SerializedName = @"locations", + PossibleTypes = new [] { typeof(string) })] + string[] Location { get; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName Name { get; set; } + /// The type of the resource, usually it is 'storageAccounts'. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The type of the resource, usually it is 'storageAccounts'.", + SerializedName = @"resourceType", + PossibleTypes = new [] { typeof(string) })] + string ResourceType { get; } + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The restrictions because of which SKU cannot be used. This is empty if there are no restrictions.", + SerializedName = @"restrictions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction[] Restriction { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Tier { get; } + + } + /// Storage SKU and its properties + internal partial interface ISkuInformationInternal + + { + /// + /// The capability information in the specified SKU, including file encryption, network ACLs, change notification, etc. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability[] Capability { get; set; } + /// Indicates the type of storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get; set; } + /// + /// The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, + /// East US, Southeast Asia, etc.). + /// + string[] Location { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName Name { get; set; } + /// The type of the resource, usually it is 'storageAccounts'. + string ResourceType { get; set; } + /// + /// The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction[] Restriction { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Tier { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.json.cs new file mode 100644 index 000000000000..1bdeb9f9e277 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SkuInformation.json.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Storage SKU and its properties + public partial class SkuInformation + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new SkuInformation(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal SkuInformation(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_tier = If( json?.PropertyT("tier"), out var __jsonTier) ? (string)__jsonTier : (string)Tier;} + {_resourceType = If( json?.PropertyT("resourceType"), out var __jsonResourceType) ? (string)__jsonResourceType : (string)ResourceType;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_location = If( json?.PropertyT("locations"), out var __jsonLocations) ? If( __jsonLocations as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(string) (__u is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString __t ? (string)(__t.ToString()) : null)) ))() : null : Location;} + {_capability = If( json?.PropertyT("capabilities"), out var __jsonCapabilities) ? If( __jsonCapabilities as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __q) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__q, (__p)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuCapability) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuCapability.FromJson(__p) )) ))() : null : Capability;} + {_restriction = If( json?.PropertyT("restrictions"), out var __jsonRestrictions) ? If( __jsonRestrictions as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __l) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__l, (__k)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRestriction) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Restriction.FromJson(__k) )) ))() : null : Restriction;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tier.ToString()) : null, "tier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._resourceType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resourceType.ToString()) : null, "resourceType" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._location) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._location ) + { + AddIf(null != (((object)__x)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(__x.ToString()) : null ,__w.Add); + } + container.Add("locations",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._capability) + { + var __r = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __s in this._capability ) + { + AddIf(__s?.ToJson(null, serializationMode) ,__r.Add); + } + container.Add("capabilities",__r); + } + } + if (null != this._restriction) + { + var __m = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __n in this._restriction ) + { + AddIf(__n?.ToJson(null, serializationMode) ,__m.Add); + } + container.Add("restrictions",__m); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.PowerShell.cs new file mode 100644 index 000000000000..16adb82f7cc9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Setting for SMB protocol + [System.ComponentModel.TypeConverter(typeof(SmbSettingTypeConverter))] + public partial class SmbSetting + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SmbSetting(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SmbSetting(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SmbSetting(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Multichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Multichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("Multichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Multichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).AuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("KerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).KerberosTicketEncryption = (string) content.GetValueForProperty("KerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).KerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("ChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).ChannelEncryption = (string) content.GetValueForProperty("ChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).ChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SmbSetting(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Multichannel")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Multichannel = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel) content.GetValueForProperty("Multichannel",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Multichannel, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.MultichannelTypeConverter.ConvertFrom); + } + if (content.Contains("Version")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Version = (string) content.GetValueForProperty("Version",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).Version, global::System.Convert.ToString); + } + if (content.Contains("AuthenticationMethod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).AuthenticationMethod = (string) content.GetValueForProperty("AuthenticationMethod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).AuthenticationMethod, global::System.Convert.ToString); + } + if (content.Contains("KerberosTicketEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).KerberosTicketEncryption = (string) content.GetValueForProperty("KerberosTicketEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).KerberosTicketEncryption, global::System.Convert.ToString); + } + if (content.Contains("ChannelEncryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).ChannelEncryption = (string) content.GetValueForProperty("ChannelEncryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).ChannelEncryption, global::System.Convert.ToString); + } + if (content.Contains("MultichannelEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).MultichannelEnabled = (bool?) content.GetValueForProperty("MultichannelEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal)this).MultichannelEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Setting for SMB protocol + [System.ComponentModel.TypeConverter(typeof(SmbSettingTypeConverter))] + public partial interface ISmbSetting + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.TypeConverter.cs new file mode 100644 index 000000000000..aeddaff009ee --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SmbSettingTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SmbSetting.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SmbSetting.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SmbSetting.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.cs b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.cs new file mode 100644 index 000000000000..55345259ccf5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Setting for SMB protocol + public partial class SmbSetting : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal + { + + /// Backing field for property. + private string _authenticationMethod; + + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string AuthenticationMethod { get => this._authenticationMethod; set => this._authenticationMethod = value; } + + /// Backing field for property. + private string _channelEncryption; + + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ChannelEncryption { get => this._channelEncryption; set => this._channelEncryption = value; } + + /// Backing field for property. + private string _kerberosTicketEncryption; + + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KerberosTicketEncryption { get => this._kerberosTicketEncryption; set => this._kerberosTicketEncryption = value; } + + /// Internal Acessors for Multichannel + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSettingInternal.Multichannel { get => (this._multichannel = this._multichannel ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Multichannel()); set { {_multichannel = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel _multichannel; + + /// Multichannel setting. Applies to Premium FileStorage only. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel Multichannel { get => (this._multichannel = this._multichannel ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Multichannel()); set => this._multichannel = value; } + + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? MultichannelEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannelInternal)Multichannel).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannelInternal)Multichannel).Enabled = value ?? default(bool); } + + /// Backing field for property. + private string _version; + + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Version { get => this._version; set => this._version = value; } + + /// Creates an new instance. + public SmbSetting() + { + + } + } + /// Setting for SMB protocol + public partial interface ISmbSetting : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter ';'.", + SerializedName = @"authenticationMethods", + PossibleTypes = new [] { typeof(string) })] + string AuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as a string with delimiter ';'.", + SerializedName = @"channelEncryption", + PossibleTypes = new [] { typeof(string) })] + string ChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with delimiter ';'", + SerializedName = @"kerberosTicketEncryption", + PossibleTypes = new [] { typeof(string) })] + string KerberosTicketEncryption { get; set; } + /// Indicates whether multichannel is enabled + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether multichannel is enabled", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? MultichannelEnabled { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with delimiter ';'.", + SerializedName = @"versions", + PossibleTypes = new [] { typeof(string) })] + string Version { get; set; } + + } + /// Setting for SMB protocol + internal partial interface ISmbSettingInternal + + { + /// + /// SMB authentication methods supported by server. Valid values are NTLMv2, Kerberos. Should be passed as a string with delimiter + /// ';'. + /// + string AuthenticationMethod { get; set; } + /// + /// SMB channel encryption supported by server. Valid values are AES-128-CCM, AES-128-GCM, AES-256-GCM. Should be passed as + /// a string with delimiter ';'. + /// + string ChannelEncryption { get; set; } + /// + /// Kerberos ticket encryption supported by server. Valid values are RC4-HMAC, AES-256. Should be passed as a string with + /// delimiter ';' + /// + string KerberosTicketEncryption { get; set; } + /// Multichannel setting. Applies to Premium FileStorage only. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IMultichannel Multichannel { get; set; } + /// Indicates whether multichannel is enabled + bool? MultichannelEnabled { get; set; } + /// + /// SMB protocol versions supported by server. Valid values are SMB2.1, SMB3.0, SMB3.1.1. Should be passed as a string with + /// delimiter ';'. + /// + string Version { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.json.cs new file mode 100644 index 000000000000..ae8d784e1d76 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SmbSetting.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Setting for SMB protocol + public partial class SmbSetting + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISmbSetting FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new SmbSetting(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal SmbSetting(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_multichannel = If( json?.PropertyT("multichannel"), out var __jsonMultichannel) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Multichannel.FromJson(__jsonMultichannel) : Multichannel;} + {_version = If( json?.PropertyT("versions"), out var __jsonVersions) ? (string)__jsonVersions : (string)Version;} + {_authenticationMethod = If( json?.PropertyT("authenticationMethods"), out var __jsonAuthenticationMethods) ? (string)__jsonAuthenticationMethods : (string)AuthenticationMethod;} + {_kerberosTicketEncryption = If( json?.PropertyT("kerberosTicketEncryption"), out var __jsonKerberosTicketEncryption) ? (string)__jsonKerberosTicketEncryption : (string)KerberosTicketEncryption;} + {_channelEncryption = If( json?.PropertyT("channelEncryption"), out var __jsonChannelEncryption) ? (string)__jsonChannelEncryption : (string)ChannelEncryption;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._multichannel ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._multichannel.ToJson(null,serializationMode) : null, "multichannel" ,container.Add ); + AddIf( null != (((object)this._version)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._version.ToString()) : null, "versions" ,container.Add ); + AddIf( null != (((object)this._authenticationMethod)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._authenticationMethod.ToString()) : null, "authenticationMethods" ,container.Add ); + AddIf( null != (((object)this._kerberosTicketEncryption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._kerberosTicketEncryption.ToString()) : null, "kerberosTicketEncryption" ,container.Add ); + AddIf( null != (((object)this._channelEncryption)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._channelEncryption.ToString()) : null, "channelEncryption" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.PowerShell.cs new file mode 100644 index 000000000000..71dd0c1484db --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(SshPublicKeyTypeConverter))] + public partial class SshPublicKey + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new SshPublicKey(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new SshPublicKey(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal SshPublicKey(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal SshPublicKey(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Description")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Description = (string) content.GetValueForProperty("Description",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Description, global::System.Convert.ToString); + } + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Key = (string) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal)this).Key, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(SshPublicKeyTypeConverter))] + public partial interface ISshPublicKey + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.TypeConverter.cs new file mode 100644 index 000000000000..7e3ad6830c12 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class SshPublicKeyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return SshPublicKey.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return SshPublicKey.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return SshPublicKey.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.cs b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.cs new file mode 100644 index 000000000000..0dec885607f1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.cs @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class SshPublicKey : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKeyInternal + { + + /// Backing field for property. + private string _description; + + /// Optional. It is used to store the function/usage of the key + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Description { get => this._description; set => this._description = value; } + + /// Backing field for property. + private string _key; + + /// + /// Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Key { get => this._key; set => this._key = value; } + + /// Creates an new instance. + public SshPublicKey() + { + + } + } + public partial interface ISshPublicKey : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Optional. It is used to store the function/usage of the key + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. It is used to store the function/usage of the key", + SerializedName = @"description", + PossibleTypes = new [] { typeof(string) })] + string Description { get; set; } + /// + /// Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB", + SerializedName = @"key", + PossibleTypes = new [] { typeof(string) })] + string Key { get; set; } + + } + internal partial interface ISshPublicKeyInternal + + { + /// Optional. It is used to store the function/usage of the key + string Description { get; set; } + /// + /// Ssh public key base64 encoded. The format should be: ' ', e.g. ssh-rsa AAAABBBB + /// + string Key { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.json.cs new file mode 100644 index 000000000000..913166501763 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/SshPublicKey.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class SshPublicKey + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new SshPublicKey(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal SshPublicKey(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_description = If( json?.PropertyT("description"), out var __jsonDescription) ? (string)__jsonDescription : (string)Description;} + {_key = If( json?.PropertyT("key"), out var __jsonKey) ? (string)__jsonKey : (string)Key;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._description)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._description.ToString()) : null, "description" ,container.Add ); + AddIf( null != (((object)this._key)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._key.ToString()) : null, "key" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.PowerShell.cs new file mode 100644 index 000000000000..1a73502bf7c6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.PowerShell.cs @@ -0,0 +1,1224 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountTypeConverter))] + public partial class StorageAccount + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccount(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccount(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccount(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("PrimaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus) content.GetValueForProperty("PropertiesBlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("SkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LastGeoFailoverTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SecondaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey1, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyCreationTimeKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey2, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusStartTime = (string) content.GetValueForProperty("SkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusEndTime = (string) content.GetValueForProperty("SkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatLastSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("GeoReplicationStatCanFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("PropertiesBlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("SkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("SkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterTimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterBlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccount(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResourceTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("PrimaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus) content.GetValueForProperty("PropertiesBlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("SkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LastGeoFailoverTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SecondaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey1, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyCreationTimeKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyCreationTimeKey2, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusStartTime = (string) content.GetValueForProperty("SkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("SkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusEndTime = (string) content.GetValueForProperty("SkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatLastSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("GeoReplicationStatCanFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("PropertiesBlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("PropertiesBlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PropertiesBlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("SkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("SkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterTimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterBlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountTypeConverter))] + public partial interface IStorageAccount + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.TypeConverter.cs new file mode 100644 index 000000000000..df4c95199603 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccount.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccount.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccount.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.cs new file mode 100644 index 000000000000..222a0e4232b7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.cs @@ -0,0 +1,2211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account. + public partial class StorageAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResource(); + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AccessTier; } + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyAccountType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); } + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyAzureStorageSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyAzureStorageSid = value ?? null; } + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainGuid = value ?? null; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainName = value ?? null; } + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyDomainSid = value ?? null; } + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyForestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyForestName = value ?? null; } + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyNetBiosDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertyNetBiosDomainName = value ?? null; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertySamAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowBlobPublicAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowBlobPublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowBlobPublicAccess = value ?? default(bool); } + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowCrossTenantReplication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowCrossTenantReplication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowCrossTenantReplication = value ?? default(bool); } + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowSharedKeyAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowSharedKeyAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowSharedKeyAccess = value ?? default(bool); } + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowedCopyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AllowedCopyScope = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope)""); } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// Failure reason when blob restore is failed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string BlobRestoreStatusFailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusFailureReason; } + + /// Id for tracking blob restore request. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string BlobRestoreStatusRestoreId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusRestoreId; } + + /// Gets the creation date and time of the storage account in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CreationTime; } + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string CustomDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CustomDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CustomDomainName = value ?? null; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? CustomDomainUseSubDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CustomDomainUseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CustomDomainUseSubDomainName = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? DefaultToOAuthAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).DefaultToOAuthAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).DefaultToOAuthAuthentication = value ?? default(bool); } + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).DnsEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).DnsEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); } + + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableHttpsTrafficOnly { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).EnableHttpsTrafficOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).EnableHttpsTrafficOnly = value ?? default(bool); } + + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableNfsV3 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).EnableNfsV3; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).EnableNfsV3 = value ?? default(bool); } + + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).Encryption; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation _extendedLocation; + + /// The extendedLocation of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes)""); } + + /// + /// If the failover is in progress, the value will be true, otherwise, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? FailoverInProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).FailoverInProgress; } + + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? GeoReplicationStatCanFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanFailover; } + + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? GeoReplicationStatLastSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatLastSyncTime; } + + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? GeoReplicationStatStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatStatus; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Id; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity _identity; + + /// The identity of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId; } + + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType)""); } + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutabilityPolicyAllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioningEnabled = value ?? default(bool); } + + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsHnsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).IsHnsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).IsHnsEnabled = value ?? default(bool); } + + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsLocalUserEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).IsLocalUserEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).IsLocalUserEnabled = value ?? default(bool); } + + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsSftpEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).IsSftpEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).IsSftpEnabled = value ?? default(bool); } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyCreationTimeKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyCreationTimeKey1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyCreationTimeKey1 = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyCreationTimeKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyCreationTimeKey2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyCreationTimeKey2 = value ?? default(global::System.DateTime); } + + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? KeyPolicyKeyExpirationPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyPolicyKeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyPolicyKeyExpirationPeriodInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? _kind; + + /// Gets the Kind. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get => this._kind; } + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).LargeFileSharesState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).LargeFileSharesState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState)""); } + + /// + /// Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp + /// is retained. This element is not returned if there has never been a failover instance. Only available if the accountType + /// is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? LastGeoFailoverTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).LastGeoFailoverTime; } + + /// The geo-location where the resource lives + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Location { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)__trackedResource).Location; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)__trackedResource).Location = value ; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Type = value; } + + /// Internal Acessors for AccessTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.AccessTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AccessTier = value; } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.AzureFilesIdentityBasedAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFilesIdentityBasedAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).AzureFilesIdentityBasedAuthentication = value; } + + /// Internal Acessors for BlobRestoreStatusFailureReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.BlobRestoreStatusFailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusFailureReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusFailureReason = value; } + + /// Internal Acessors for BlobRestoreStatusParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.BlobRestoreStatusParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusParameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusParameter = value; } + + /// Internal Acessors for BlobRestoreStatusRestoreId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.BlobRestoreStatusRestoreId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusRestoreId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusRestoreId = value; } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.CreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CreationTime = value; } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.CustomDomain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CustomDomain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).CustomDomain = value; } + + /// Internal Acessors for Encryption + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).Encryption = value; } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for FailoverInProgress + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.FailoverInProgress { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).FailoverInProgress; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).FailoverInProgress = value; } + + /// Internal Acessors for GeoReplicationStat + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.GeoReplicationStat { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStat; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStat = value; } + + /// Internal Acessors for GeoReplicationStatCanFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.GeoReplicationStatCanFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanFailover; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatCanFailover = value; } + + /// Internal Acessors for GeoReplicationStatLastSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.GeoReplicationStatLastSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatLastSyncTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatLastSyncTime = value; } + + /// Internal Acessors for GeoReplicationStatStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.GeoReplicationStatStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).GeoReplicationStatStatus = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy = value; } + + /// Internal Acessors for KeyCreationTime + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.KeyCreationTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyCreationTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyCreationTime = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.KeyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).KeyPolicy = value; } + + /// Internal Acessors for Kind + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.Kind { get => this._kind; set { {_kind = value;} } } + + /// Internal Acessors for LastGeoFailoverTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.LastGeoFailoverTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).LastGeoFailoverTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).LastGeoFailoverTime = value; } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.NetworkRuleSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSet = value; } + + /// Internal Acessors for PrimaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointBlob = value; } + + /// Internal Acessors for PrimaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointDf = value; } + + /// Internal Acessors for PrimaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointFile = value; } + + /// Internal Acessors for PrimaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointInternetEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointMicrosoftEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointQueue = value; } + + /// Internal Acessors for PrimaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointTable = value; } + + /// Internal Acessors for PrimaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointWeb = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsBlob = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsDf = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsFile = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsWeb = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsBlob = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsDf = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsFile = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsQueue = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsTable = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsWeb = value; } + + /// Internal Acessors for PrimaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrimaryLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryLocation = value; } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrivateEndpointConnection; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrivateEndpointConnection = value; } + + /// Internal Acessors for PropertiesBlobRestoreStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PropertiesBlobRestoreStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatus = value; } + + /// Internal Acessors for PropertiesBlobRestoreStatusStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.PropertiesBlobRestoreStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusStatus = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountProperties()); set { {_property = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ProvisioningState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ProvisioningState = value; } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.RoutingPreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreference = value; } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SasPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SasPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SasPolicy = value; } + + /// Internal Acessors for SasPolicyExpirationAction + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SasPolicyExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SasPolicyExpirationAction = value; } + + /// Internal Acessors for SecondaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointBlob = value; } + + /// Internal Acessors for SecondaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointDf = value; } + + /// Internal Acessors for SecondaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointFile = value; } + + /// Internal Acessors for SecondaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointInternetEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointMicrosoftEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointQueue = value; } + + /// Internal Acessors for SecondaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointTable = value; } + + /// Internal Acessors for SecondaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointWeb = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsBlob = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsDf = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsFile = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsWeb = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsBlob = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsDf = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsFile = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsQueue = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsTable = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsWeb = value; } + + /// Internal Acessors for SecondaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SecondaryLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryLocation; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryLocation = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatus = value; } + + /// Internal Acessors for SkuConversionStatusEndTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SkuConversionStatusEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusEndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusEndTime = value; } + + /// Internal Acessors for SkuConversionStatusSkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SkuConversionStatusSkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusSkuConversionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusSkuConversionStatus = value; } + + /// Internal Acessors for SkuConversionStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SkuConversionStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusStartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusStartTime = value; } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier = value; } + + /// Internal Acessors for StatusOfPrimary + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.StatusOfPrimary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StatusOfPrimary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StatusOfPrimary = value; } + + /// Internal Acessors for StatusOfSecondary + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternal.StatusOfSecondary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StatusOfSecondary; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StatusOfSecondary = value; } + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).MinimumTlsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).MinimumTlsVersion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion)""); } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Name; } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetBypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetBypass = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); } + + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetDefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetDefaultAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); } + + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetIPRule = value ?? null /* arrayOf */; } + + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetResourceAccessRule = value ?? null /* arrayOf */; } + + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetVirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).NetworkRuleSetVirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ParameterBlobRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ParameterBlobRange = value ?? null /* arrayOf */; } + + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterTimeToRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ParameterTimeToRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ParameterTimeToRestore = value ?? default(global::System.DateTime); } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointFile; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointQueue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointTable; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointWeb; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsFile; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsInternetEndpointsWeb; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsFile; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsQueue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsTable; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryEndpointsMicrosoftEndpointsWeb; } + + /// Gets the location of the primary data center for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrimaryLocation; } + + /// + /// List of private endpoint connection associated with the specified storage account + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] PrivateEndpointConnection { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PrivateEndpointConnection; } + + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? PropertiesBlobRestoreStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).BlobRestoreStatusStatus; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties _property; + + /// Properties of the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountProperties()); set => this._property = value; } + + /// Gets the status of the storage account at the time the operation was called. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).ProvisioningState; } + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess)""); } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreferencePublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreferencePublishInternetEndpoint = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreferencePublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreferencePublishMicrosoftEndpoint = value ?? default(bool); } + + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreferenceRoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).RoutingPreferenceRoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SasPolicyExpirationAction; } + + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicySasExpirationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SasPolicySasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SasPolicySasExpirationPeriod = value ?? null; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointFile; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointQueue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointTable; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointWeb; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsFile; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsInternetEndpointsWeb; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsFile; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsQueue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsTable; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryEndpointsMicrosoftEndpointsWeb; } + + /// + /// Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS + /// or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryLocation { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).SecondaryLocation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku _sku; + + /// Gets the SKU. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); } + + /// This property represents the sku conversion end time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SkuConversionStatusEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusEndTime; } + + /// This property indicates the current sku conversion status. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? SkuConversionStatusSkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusSkuConversionStatus; } + + /// This property represents the sku conversion start time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SkuConversionStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusStartTime; } + + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuConversionStatusTargetSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusTargetSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StorageAccountSkuConversionStatusTargetSkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); } + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; } + + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfPrimary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StatusOfPrimary; } + + /// + /// Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available + /// if the SKU name is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfSecondary { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)Property).StatusOfSecondary; } + + /// Resource tags. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceTags Tag { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal)__trackedResource).Tag = value ?? null /* model class */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__trackedResource).Type; } + + /// Creates an new instance. + public StorageAccount() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__trackedResource), __trackedResource); + await eventListener.AssertObjectIsValid(nameof(__trackedResource), __trackedResource); + } + } + /// The storage account. + public partial interface IStorageAccount : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResource + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; } + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Failure reason when blob restore is failed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Failure reason when blob restore is failed.", + SerializedName = @"failureReason", + PossibleTypes = new [] { typeof(string) })] + string BlobRestoreStatusFailureReason { get; } + /// Id for tracking blob restore request. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Id for tracking blob restore request.", + SerializedName = @"restoreId", + PossibleTypes = new [] { typeof(string) })] + string BlobRestoreStatusRestoreId { get; } + /// Gets the creation date and time of the storage account in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the creation date and time of the storage account in UTC.", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationTime { get; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(bool) })] + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(bool) })] + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NFS 3.0 protocol support enabled if set to true.", + SerializedName = @"isNfsV3Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Encryption settings to be used for server-side encryption for the storage account.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; } + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? ExtendedLocationType { get; set; } + /// + /// If the failover is in progress, the value will be true, otherwise, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If the failover is in progress, the value will be true, otherwise, it will be null.", + SerializedName = @"failoverInProgress", + PossibleTypes = new [] { typeof(bool) })] + bool? FailoverInProgress { get; } + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A boolean flag which indicates whether or not account failover is supported for the account.", + SerializedName = @"canFailover", + PossibleTypes = new [] { typeof(bool) })] + bool? GeoReplicationStatCanFailover { get; } + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap.", + SerializedName = @"lastSyncTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? GeoReplicationStatLastSyncTime { get; } + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? GeoReplicationStatStatus { get; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account HierarchicalNamespace enabled if sets to true.", + SerializedName = @"isHnsEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSftpEnabled { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"key1", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyCreationTimeKey1 { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"key2", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyCreationTimeKey2 { get; set; } + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// Gets the Kind. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the Kind.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp + /// is retained. This element is not returned if there has never been a failover instance. Only available if the accountType + /// is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS.", + SerializedName = @"lastGeoFailoverTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastGeoFailoverTime { get; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob ranges to restore.", + SerializedName = @"blobRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get; set; } + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restore blob to the specified time.", + SerializedName = @"timeToRestore", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterTimeToRestore { get; set; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsFile { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsWeb { get; } + /// Gets the location of the primary data center for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the location of the primary data center for the storage account.", + SerializedName = @"primaryLocation", + PossibleTypes = new [] { typeof(string) })] + string PrimaryLocation { get; } + /// + /// List of private endpoint connection associated with the specified storage account + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of private endpoint connection associated with the specified storage account", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? PropertiesBlobRestoreStatusStatus { get; } + /// Gets the status of the storage account at the time the operation was called. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the status of the storage account at the time the operation was called.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SAS expiration action. Can only be Log.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(string) })] + string SasPolicyExpirationAction { get; } + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + string SasPolicySasExpirationPeriod { get; set; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsFile { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsWeb { get; } + /// + /// Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS + /// or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS.", + SerializedName = @"secondaryLocation", + PossibleTypes = new [] { typeof(string) })] + string SecondaryLocation { get; } + /// This property represents the sku conversion end time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property represents the sku conversion end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(string) })] + string SkuConversionStatusEndTime { get; } + /// This property indicates the current sku conversion status. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property indicates the current sku conversion status.", + SerializedName = @"skuConversionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? SkuConversionStatusSkuConversionStatus { get; } + /// This property represents the sku conversion start time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property represents the sku conversion start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string SkuConversionStatusStartTime { get; } + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property represents the target sku name to which the account sku is being converted asynchronously.", + SerializedName = @"targetSkuName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuConversionStatusTargetSkuName { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; } + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the status indicating whether the primary location of the storage account is available or unavailable.", + SerializedName = @"statusOfPrimary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfPrimary { get; } + /// + /// Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available + /// if the SKU name is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS.", + SerializedName = @"statusOfSecondary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfSecondary { get; } + + } + /// The storage account. + internal partial interface IStorageAccountInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.ITrackedResourceInternal + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Provides the identity based authentication settings for Azure Files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; } + /// Failure reason when blob restore is failed. + string BlobRestoreStatusFailureReason { get; set; } + /// Blob restore request parameters. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters BlobRestoreStatusParameter { get; set; } + /// Id for tracking blob restore request. + string BlobRestoreStatusRestoreId { get; set; } + /// Gets the creation date and time of the storage account in UTC. + global::System.DateTime? CreationTime { get; set; } + /// Gets the custom domain the user assigned to this storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// The extendedLocation of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation ExtendedLocation { get; set; } + /// The name of the extended location. + string ExtendedLocationName { get; set; } + /// The type of the extended location. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? ExtendedLocationType { get; set; } + /// + /// If the failover is in progress, the value will be true, otherwise, it will be null. + /// + bool? FailoverInProgress { get; set; } + /// Geo Replication Stats + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats GeoReplicationStat { get; set; } + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + bool? GeoReplicationStatCanFailover { get; set; } + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + global::System.DateTime? GeoReplicationStatLastSyncTime { get; set; } + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? GeoReplicationStatStatus { get; set; } + /// The identity of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// The identity type. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the containers in the account by default. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutableStorageWithVersioningImmutabilityPolicy { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + bool? IsSftpEnabled { get; set; } + /// Storage account keys creation time. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime KeyCreationTime { get; set; } + + global::System.DateTime? KeyCreationTimeKey1 { get; set; } + + global::System.DateTime? KeyCreationTimeKey2 { get; set; } + /// KeyPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get; set; } + /// The key expiration period in days. + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// Gets the Kind. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp + /// is retained. This element is not returned if there has never been a failover instance. Only available if the accountType + /// is Standard_GRS or Standard_RAGRS. + /// + global::System.DateTime? LastGeoFailoverTime { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// Network rule set + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// Blob ranges to restore. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get; set; } + /// Restore blob to the specified time. + global::System.DateTime? ParameterTimeToRestore { get; set; } + /// + /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and + /// Premium_LRS accounts only return the blob endpoint. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints PrimaryEndpoint { get; set; } + /// Gets the blob endpoint. + string PrimaryEndpointBlob { get; set; } + /// Gets the dfs endpoint. + string PrimaryEndpointDf { get; set; } + /// Gets the file endpoint. + string PrimaryEndpointFile { get; set; } + /// Gets the internet routing storage endpoints + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints PrimaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints PrimaryEndpointMicrosoftEndpoint { get; set; } + /// Gets the queue endpoint. + string PrimaryEndpointQueue { get; set; } + /// Gets the table endpoint. + string PrimaryEndpointTable { get; set; } + /// Gets the web endpoint. + string PrimaryEndpointWeb { get; set; } + /// Gets the blob endpoint. + string PrimaryEndpointsInternetEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string PrimaryEndpointsInternetEndpointsDf { get; set; } + /// Gets the file endpoint. + string PrimaryEndpointsInternetEndpointsFile { get; set; } + /// Gets the web endpoint. + string PrimaryEndpointsInternetEndpointsWeb { get; set; } + /// Gets the blob endpoint. + string PrimaryEndpointsMicrosoftEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string PrimaryEndpointsMicrosoftEndpointsDf { get; set; } + /// Gets the file endpoint. + string PrimaryEndpointsMicrosoftEndpointsFile { get; set; } + /// Gets the queue endpoint. + string PrimaryEndpointsMicrosoftEndpointsQueue { get; set; } + /// Gets the table endpoint. + string PrimaryEndpointsMicrosoftEndpointsTable { get; set; } + /// Gets the web endpoint. + string PrimaryEndpointsMicrosoftEndpointsWeb { get; set; } + /// Gets the location of the primary data center for the storage account. + string PrimaryLocation { get; set; } + /// + /// List of private endpoint connection associated with the specified storage account + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Blob restore status + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus PropertiesBlobRestoreStatus { get; set; } + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? PropertiesBlobRestoreStatusStatus { get; set; } + /// Properties of the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties Property { get; set; } + /// Gets the status of the storage account at the time the operation was called. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// SasPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get; set; } + /// The SAS expiration action. Can only be Log. + string SasPolicyExpirationAction { get; set; } + /// The SAS expiration period, DD.HH:MM:SS. + string SasPolicySasExpirationPeriod { get; set; } + /// + /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location + /// of the storage account. Only available if the SKU name is Standard_RAGRS. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints SecondaryEndpoint { get; set; } + /// Gets the blob endpoint. + string SecondaryEndpointBlob { get; set; } + /// Gets the dfs endpoint. + string SecondaryEndpointDf { get; set; } + /// Gets the file endpoint. + string SecondaryEndpointFile { get; set; } + /// Gets the internet routing storage endpoints + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints SecondaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints SecondaryEndpointMicrosoftEndpoint { get; set; } + /// Gets the queue endpoint. + string SecondaryEndpointQueue { get; set; } + /// Gets the table endpoint. + string SecondaryEndpointTable { get; set; } + /// Gets the web endpoint. + string SecondaryEndpointWeb { get; set; } + /// Gets the blob endpoint. + string SecondaryEndpointsInternetEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string SecondaryEndpointsInternetEndpointsDf { get; set; } + /// Gets the file endpoint. + string SecondaryEndpointsInternetEndpointsFile { get; set; } + /// Gets the web endpoint. + string SecondaryEndpointsInternetEndpointsWeb { get; set; } + /// Gets the blob endpoint. + string SecondaryEndpointsMicrosoftEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string SecondaryEndpointsMicrosoftEndpointsDf { get; set; } + /// Gets the file endpoint. + string SecondaryEndpointsMicrosoftEndpointsFile { get; set; } + /// Gets the queue endpoint. + string SecondaryEndpointsMicrosoftEndpointsQueue { get; set; } + /// Gets the table endpoint. + string SecondaryEndpointsMicrosoftEndpointsTable { get; set; } + /// Gets the web endpoint. + string SecondaryEndpointsMicrosoftEndpointsWeb { get; set; } + /// + /// Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS + /// or Standard_RAGRS. + /// + string SecondaryLocation { get; set; } + /// Gets the SKU. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get; set; } + /// + /// This property is readOnly and is set by server during asynchronous storage account sku conversion operations. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus SkuConversionStatus { get; set; } + /// This property represents the sku conversion end time. + string SkuConversionStatusEndTime { get; set; } + /// This property indicates the current sku conversion status. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? SkuConversionStatusSkuConversionStatus { get; set; } + /// This property represents the sku conversion start time. + string SkuConversionStatusStartTime { get; set; } + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuConversionStatusTargetSkuName { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; set; } + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfPrimary { get; set; } + /// + /// Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available + /// if the SKU name is Standard_GRS or Standard_RAGRS. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfSecondary { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.json.cs new file mode 100644 index 000000000000..c0a4346d6a20 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccount.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The storage account. + public partial class StorageAccount + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccount(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccount(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __trackedResource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.TrackedResource(json); + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity.FromJson(__jsonIdentity) : Identity;} + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountProperties.FromJson(__jsonProperties) : Property;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __trackedResource?.ToJson(container, serializationMode); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + } + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.PowerShell.cs new file mode 100644 index 000000000000..3112f43114df --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.PowerShell.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The parameters used to check the availability of the storage account name. + [System.ComponentModel.TypeConverter(typeof(StorageAccountCheckNameAvailabilityParametersTypeConverter))] + public partial class StorageAccountCheckNameAvailabilityParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountCheckNameAvailabilityParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountCheckNameAvailabilityParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from + /// a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountCheckNameAvailabilityParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountCheckNameAvailabilityParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal)this).Type, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters used to check the availability of the storage account name. + [System.ComponentModel.TypeConverter(typeof(StorageAccountCheckNameAvailabilityParametersTypeConverter))] + public partial interface IStorageAccountCheckNameAvailabilityParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.TypeConverter.cs new file mode 100644 index 000000000000..0aa076810290 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountCheckNameAvailabilityParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, + /// otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountCheckNameAvailabilityParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountCheckNameAvailabilityParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountCheckNameAvailabilityParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.cs new file mode 100644 index 000000000000..0deebe3a340c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used to check the availability of the storage account name. + public partial class StorageAccountCheckNameAvailabilityParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal + { + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParametersInternal.Type { get => this._type; set { {_type = value;} } } + + /// Backing field for property. + private string _name; + + /// The storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _type= @"Microsoft.Storage/storageAccounts"; + + /// The type of resource, Microsoft.Storage/storageAccounts + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Type { get => this._type; } + + /// + /// Creates an new instance. + /// + public StorageAccountCheckNameAvailabilityParameters() + { + + } + } + /// The parameters used to check the availability of the storage account name. + public partial interface IStorageAccountCheckNameAvailabilityParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The storage account name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// The type of resource, Microsoft.Storage/storageAccounts + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = true, + Description = @"The type of resource, Microsoft.Storage/storageAccounts", + SerializedName = @"type", + PossibleTypes = new [] { typeof(string) })] + string Type { get; } + + } + /// The parameters used to check the availability of the storage account name. + internal partial interface IStorageAccountCheckNameAvailabilityParametersInternal + + { + /// The storage account name. + string Name { get; set; } + /// The type of resource, Microsoft.Storage/storageAccounts + string Type { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.json.cs new file mode 100644 index 000000000000..75e0040553a7 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCheckNameAvailabilityParameters.json.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used to check the availability of the storage account name. + public partial class StorageAccountCheckNameAvailabilityParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountCheckNameAvailabilityParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCheckNameAvailabilityParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_type = If( json?.PropertyT("type"), out var __jsonType) ? (string)__jsonType : (string)Type;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._type)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._type.ToString()) : null, "type" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.PowerShell.cs new file mode 100644 index 000000000000..ba085989d925 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.PowerShell.cs @@ -0,0 +1,674 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The parameters used when creating a storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountCreateParametersTypeConverter))] + public partial class StorageAccountCreateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountCreateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountCreateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountCreateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesCreateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountCreateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocation = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation) content.GetValueForProperty("ExtendedLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocation, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocationTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesCreateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("ExtendedLocationName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName = (string) content.GetValueForProperty("ExtendedLocationName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationName, global::System.Convert.ToString); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("ExtendedLocationType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes?) content.GetValueForProperty("ExtendedLocationType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ExtendedLocationType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes.CreateFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters used when creating a storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountCreateParametersTypeConverter))] + public partial interface IStorageAccountCreateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.TypeConverter.cs new file mode 100644 index 000000000000..28fc06c544e8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountCreateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountCreateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountCreateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountCreateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.cs new file mode 100644 index 000000000000..4516c25af22d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.cs @@ -0,0 +1,1146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used when creating a storage account. + public partial class StorageAccountCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal + { + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AccessTier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier)""); } + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyAccountType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); } + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyAzureStorageSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyAzureStorageSid = value ?? null; } + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainGuid = value ?? null; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainName = value ?? null; } + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyDomainSid = value ?? null; } + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyForestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyForestName = value ?? null; } + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyNetBiosDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertyNetBiosDomainName = value ?? null; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertySamAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowBlobPublicAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowBlobPublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowBlobPublicAccess = value ?? default(bool); } + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowCrossTenantReplication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowCrossTenantReplication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowCrossTenantReplication = value ?? default(bool); } + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowSharedKeyAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowSharedKeyAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowSharedKeyAccess = value ?? default(bool); } + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowedCopyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AllowedCopyScope = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope)""); } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string CustomDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomainName = value ?? null; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? CustomDomainUseSubDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomainUseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomainUseSubDomainName = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? DefaultToOAuthAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).DefaultToOAuthAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).DefaultToOAuthAuthentication = value ?? default(bool); } + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).DnsEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).DnsEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); } + + /// + /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableHttpsTrafficOnly { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableHttpsTrafficOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableHttpsTrafficOnly = value ?? default(bool); } + + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableNfsV3 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableNfsV3; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).EnableNfsV3 = value ?? default(bool); } + + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).Encryption = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation _extendedLocation; + + /// + /// Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region. + /// Otherwise it will be created in the specified extended location + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation()); set => this._extendedLocation = value; } + + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ExtendedLocationName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Name = value ?? null; } + + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? ExtendedLocationType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocationInternal)ExtendedLocation).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity _identity; + + /// The identity of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId; } + + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType)""); } + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutabilityPolicyAllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioningEnabled = value ?? default(bool); } + + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsHnsEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).IsHnsEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).IsHnsEnabled = value ?? default(bool); } + + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsLocalUserEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).IsLocalUserEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).IsLocalUserEnabled = value ?? default(bool); } + + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsSftpEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).IsSftpEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).IsSftpEnabled = value ?? default(bool); } + + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? KeyPolicyKeyExpirationPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).KeyPolicyKeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).KeyPolicyKeyExpirationPeriodInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind _kind; + + /// Required. Indicates the type of storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind Kind { get => this._kind; set => this._kind = value; } + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).LargeFileSharesState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).LargeFileSharesState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState)""); } + + /// Backing field for property. + private string _location; + + /// + /// Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions + /// (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but + /// if an identical geo region is specified on update, the request will succeed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.AzureFilesIdentityBasedAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFilesIdentityBasedAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).AzureFilesIdentityBasedAuthentication = value; } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.CustomDomain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).CustomDomain = value; } + + /// Internal Acessors for ExtendedLocation + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.ExtendedLocation { get => (this._extendedLocation = this._extendedLocation ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation()); set { {_extendedLocation = value;} } } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.KeyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).KeyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).KeyPolicy = value; } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.NetworkRuleSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSet = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesCreateParameters()); set { {_property = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.RoutingPreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreference = value; } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.SasPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicy = value; } + + /// Internal Acessors for SasPolicyExpirationAction + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicyExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicyExpirationAction = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier = value; } + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).MinimumTlsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).MinimumTlsVersion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion)""); } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetBypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetBypass = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); } + + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetDefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetDefaultAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); } + + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetIPRule = value ?? null /* arrayOf */; } + + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetResourceAccessRule = value ?? null /* arrayOf */; } + + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters _property; + + /// The parameters used to create the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesCreateParameters()); set => this._property = value; } + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess)""); } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferencePublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferencePublishInternetEndpoint = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferencePublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferencePublishMicrosoftEndpoint = value ?? default(bool); } + + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferenceRoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).RoutingPreferenceRoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicyExpirationAction; } + + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicySasExpirationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicySasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)Property).SasPolicySasExpirationPeriod = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku _sku; + + /// Required. Gets or sets the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); set => this._sku = value; } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name = value ; } + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags _tag; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public StorageAccountCreateParameters() + { + + } + } + /// The parameters used when creating a storage account. + public partial interface IStorageAccountCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(bool) })] + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(bool) })] + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// + /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NFS 3.0 protocol support enabled if set to true.", + SerializedName = @"isNfsV3Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption settings to be used for server-side encryption for the storage account.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// The name of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string ExtendedLocationName { get; set; } + /// The type of the extended location. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? ExtendedLocationType { get; set; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account HierarchicalNamespace enabled if sets to true.", + SerializedName = @"isHnsEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSftpEnabled { get; set; } + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// Required. Indicates the type of storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Indicates the type of storage account.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind Kind { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions + /// (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but + /// if an identical geo region is specified on update, the request will succeed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SAS expiration action. Can only be Log.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(string) })] + string SasPolicyExpirationAction { get; } + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + string SasPolicySasExpirationPeriod { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; } + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags Tag { get; set; } + + } + /// The parameters used when creating a storage account. + internal partial interface IStorageAccountCreateParametersInternal + + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Provides the identity based authentication settings for Azure Files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; } + /// + /// User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage + /// account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// + /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + /// + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// + /// Optional. Set the extended location of the resource. If not set, the storage account will be created in Azure main region. + /// Otherwise it will be created in the specified extended location + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IExtendedLocation ExtendedLocation { get; set; } + /// The name of the extended location. + string ExtendedLocationName { get; set; } + /// The type of the extended location. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes? ExtendedLocationType { get; set; } + /// The identity of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// The identity type. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the new containers in the account by default. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutableStorageWithVersioningImmutabilityPolicy { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + bool? IsSftpEnabled { get; set; } + /// KeyPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get; set; } + /// The key expiration period in days. + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// Required. Indicates the type of storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind Kind { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions + /// (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but + /// if an identical geo region is specified on update, the request will succeed. + /// + string Location { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// Network rule set + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// The parameters used to create the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters Property { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// SasPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get; set; } + /// The SAS expiration action. Can only be Log. + string SasPolicyExpirationAction { get; set; } + /// The SAS expiration period, DD.HH:MM:SS. + string SasPolicySasExpirationPeriod { get; set; } + /// Required. Gets or sets the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.json.cs new file mode 100644 index 000000000000..832ac8671ab8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParameters.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used when creating a storage account. + public partial class StorageAccountCreateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountCreateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountCreateParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku.FromJson(__jsonSku) : Sku;} + {_extendedLocation = If( json?.PropertyT("extendedLocation"), out var __jsonExtendedLocation) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ExtendedLocation.FromJson(__jsonExtendedLocation) : ExtendedLocation;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity.FromJson(__jsonIdentity) : Identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesCreateParameters.FromJson(__jsonProperties) : Property;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParametersTags.FromJson(__jsonTags) : Tag;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._extendedLocation ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._extendedLocation.ToJson(null,serializationMode) : null, "extendedLocation" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..abe22e5ebe0a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + /// + [System.ComponentModel.TypeConverter(typeof(StorageAccountCreateParametersTagsTypeConverter))] + public partial class StorageAccountCreateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountCreateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountCreateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountCreateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountCreateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + [System.ComponentModel.TypeConverter(typeof(StorageAccountCreateParametersTagsTypeConverter))] + public partial interface IStorageAccountCreateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..e079c6aa14ab --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountCreateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountCreateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountCreateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountCreateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.cs new file mode 100644 index 000000000000..8db128f9b67d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + /// + public partial class StorageAccountCreateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTagsInternal + { + + /// Creates an new instance. + public StorageAccountCreateParametersTags() + { + + } + } + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + public partial interface IStorageAccountCreateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + internal partial interface IStorageAccountCreateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.dictionary.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.dictionary.cs new file mode 100644 index 000000000000..317b46030801 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageAccountCreateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.json.cs new file mode 100644 index 000000000000..9af9f89146b9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountCreateParametersTags.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + /// + public partial class StorageAccountCreateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountCreateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal StorageAccountCreateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.PowerShell.cs new file mode 100644 index 000000000000..07170375a985 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.PowerShell.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + /// + [System.ComponentModel.TypeConverter(typeof(StorageAccountInternetEndpointsTypeConverter))] + public partial class StorageAccountInternetEndpoints + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountInternetEndpoints(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountInternetEndpoints(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountInternetEndpoints(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Df, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountInternetEndpoints(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal)this).Df, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + [System.ComponentModel.TypeConverter(typeof(StorageAccountInternetEndpointsTypeConverter))] + public partial interface IStorageAccountInternetEndpoints + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.TypeConverter.cs new file mode 100644 index 000000000000..7aeefcbbe16f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountInternetEndpointsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountInternetEndpoints.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountInternetEndpoints.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountInternetEndpoints.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.cs new file mode 100644 index 000000000000..c8a319e235a9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + /// + public partial class StorageAccountInternetEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal + { + + /// Backing field for property. + private string _blob; + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Blob { get => this._blob; } + + /// Backing field for property. + private string _df; + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Df { get => this._df; } + + /// Backing field for property. + private string _file; + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string File { get => this._file; } + + /// Internal Acessors for Blob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal.Blob { get => this._blob; set { {_blob = value;} } } + + /// Internal Acessors for Df + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal.Df { get => this._df; set { {_df = value;} } } + + /// Internal Acessors for File + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal.File { get => this._file; set { {_file = value;} } } + + /// Internal Acessors for Web + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpointsInternal.Web { get => this._web; set { {_web = value;} } } + + /// Backing field for property. + private string _web; + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Web { get => this._web; } + + /// Creates an new instance. + public StorageAccountInternetEndpoints() + { + + } + } + /// The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + public partial interface IStorageAccountInternetEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string Blob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string Df { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string File { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string Web { get; } + + } + /// The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + internal partial interface IStorageAccountInternetEndpointsInternal + + { + /// Gets the blob endpoint. + string Blob { get; set; } + /// Gets the dfs endpoint. + string Df { get; set; } + /// Gets the file endpoint. + string File { get; set; } + /// Gets the web endpoint. + string Web { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.json.cs new file mode 100644 index 000000000000..3ae0836bba9f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountInternetEndpoints.json.cs @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The URIs that are used to perform a retrieval of a public blob, file, web or dfs object via a internet routing endpoint. + /// + public partial class StorageAccountInternetEndpoints + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountInternetEndpoints(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountInternetEndpoints(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_blob = If( json?.PropertyT("blob"), out var __jsonBlob) ? (string)__jsonBlob : (string)Blob;} + {_file = If( json?.PropertyT("file"), out var __jsonFile) ? (string)__jsonFile : (string)File;} + {_web = If( json?.PropertyT("web"), out var __jsonWeb) ? (string)__jsonWeb : (string)Web;} + {_df = If( json?.PropertyT("dfs"), out var __jsonDfs) ? (string)__jsonDfs : (string)Df;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._blob)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._blob.ToString()) : null, "blob" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._file)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._file.ToString()) : null, "file" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._web)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._web.ToString()) : null, "web" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._df)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._df.ToString()) : null, "dfs" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.PowerShell.cs new file mode 100644 index 000000000000..29002cbf3572 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.PowerShell.cs @@ -0,0 +1,168 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// An access key for the storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountKeyTypeConverter))] + public partial class StorageAccountKey + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountKey(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountKey(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountKey(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountKey(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).KeyName, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Permission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission?) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).Permission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// An access key for the storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountKeyTypeConverter))] + public partial interface IStorageAccountKey + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.TypeConverter.cs new file mode 100644 index 000000000000..9710a6e8139a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountKeyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountKey.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountKey.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountKey.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.cs new file mode 100644 index 000000000000..da942a4bee1c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An access key for the storage account. + public partial class StorageAccountKey : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal + { + + /// Backing field for property. + private global::System.DateTime? _creationTime; + + /// Creation time of the key, in round trip date format. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? CreationTime { get => this._creationTime; } + + /// Backing field for property. + private string _keyName; + + /// Name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyName { get => this._keyName; } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for KeyName + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal.KeyName { get => this._keyName; set { {_keyName = value;} } } + + /// Internal Acessors for Permission + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal.Permission { get => this._permission; set { {_permission = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKeyInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission? _permission; + + /// Permissions for the key -- read-only or full permissions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission? Permission { get => this._permission; } + + /// Backing field for property. + private string _value; + + /// Base 64-encoded value of the key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// Creates an new instance. + public StorageAccountKey() + { + + } + } + /// An access key for the storage account. + public partial interface IStorageAccountKey : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Creation time of the key, in round trip date format. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Creation time of the key, in round trip date format.", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationTime { get; } + /// Name of the key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Name of the key.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyName { get; } + /// Permissions for the key -- read-only or full permissions. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Permissions for the key -- read-only or full permissions.", + SerializedName = @"permissions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission? Permission { get; } + /// Base 64-encoded value of the key. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Base 64-encoded value of the key.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// An access key for the storage account. + internal partial interface IStorageAccountKeyInternal + + { + /// Creation time of the key, in round trip date format. + global::System.DateTime? CreationTime { get; set; } + /// Name of the key. + string KeyName { get; set; } + /// Permissions for the key -- read-only or full permissions. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission? Permission { get; set; } + /// Base 64-encoded value of the key. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.json.cs new file mode 100644 index 000000000000..e7d939140d0c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountKey.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An access key for the storage account. + public partial class StorageAccountKey + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountKey(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountKey(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)KeyName;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_permission = If( json?.PropertyT("permissions"), out var __jsonPermissions) ? (string)__jsonPermissions : (string)Permission;} + {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? global::System.DateTime.TryParse((string)__jsonCreationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreationTimeValue) ? __jsonCreationTimeValue : CreationTime : CreationTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._permission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._permission.ToString()) : null, "permissions" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._creationTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._creationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "creationTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.PowerShell.cs new file mode 100644 index 000000000000..a8cd427f5bde --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.PowerShell.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The response from the ListKeys operation. + [System.ComponentModel.TypeConverter(typeof(StorageAccountListKeysResultTypeConverter))] + public partial class StorageAccountListKeysResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountListKeysResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountListKeysResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountListKeysResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResultInternal)this).Key = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey[]) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResultInternal)this).Key, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountKeyTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountListKeysResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Key")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResultInternal)this).Key = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey[]) content.GetValueForProperty("Key",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResultInternal)this).Key, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountKeyTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the ListKeys operation. + [System.ComponentModel.TypeConverter(typeof(StorageAccountListKeysResultTypeConverter))] + public partial interface IStorageAccountListKeysResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.TypeConverter.cs new file mode 100644 index 000000000000..22a879120db0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountListKeysResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountListKeysResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountListKeysResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountListKeysResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.cs new file mode 100644 index 000000000000..fd9bd5e39529 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the ListKeys operation. + public partial class StorageAccountListKeysResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey[] _key; + + /// + /// Gets the list of storage account keys and their properties for the specified storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey[] Key { get => this._key; } + + /// Internal Acessors for Key + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResultInternal.Key { get => this._key; set { {_key = value;} } } + + /// Creates an new instance. + public StorageAccountListKeysResult() + { + + } + } + /// The response from the ListKeys operation. + public partial interface IStorageAccountListKeysResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Gets the list of storage account keys and their properties for the specified storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the list of storage account keys and their properties for the specified storage account.", + SerializedName = @"keys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey[] Key { get; } + + } + /// The response from the ListKeys operation. + internal partial interface IStorageAccountListKeysResultInternal + + { + /// + /// Gets the list of storage account keys and their properties for the specified storage account. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey[] Key { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.json.cs new file mode 100644 index 000000000000..748d207f1e35 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListKeysResult.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the ListKeys operation. + public partial class StorageAccountListKeysResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountListKeysResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountListKeysResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_key = If( json?.PropertyT("keys"), out var __jsonKeys) ? If( __jsonKeys as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountKey.FromJson(__u) )) ))() : null : Key;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._key) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._key ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("keys",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.PowerShell.cs new file mode 100644 index 000000000000..98c902e9b8c3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The response from the List Storage Accounts operation. + [System.ComponentModel.TypeConverter(typeof(StorageAccountListResultTypeConverter))] + public partial class StorageAccountListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountTypeConverter.ConvertFrom)); + } + if (content.Contains("NextLink")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).NextLink = (string) content.GetValueForProperty("NextLink",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal)this).NextLink, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Storage Accounts operation. + [System.ComponentModel.TypeConverter(typeof(StorageAccountListResultTypeConverter))] + public partial interface IStorageAccountListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.TypeConverter.cs new file mode 100644 index 000000000000..053772592a85 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.cs new file mode 100644 index 000000000000..6bb53e21f358 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Storage Accounts operation. + public partial class StorageAccountListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal + { + + /// Internal Acessors for NextLink + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal.NextLink { get => this._nextLink; set { {_nextLink = value;} } } + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _nextLink; + + /// + /// Request URL that can be used to query next page of storage accounts. Returned when total number of requested storage accounts + /// exceed maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string NextLink { get => this._nextLink; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount[] _value; + + /// Gets the list of storage accounts and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount[] Value { get => this._value; } + + /// Creates an new instance. + public StorageAccountListResult() + { + + } + } + /// The response from the List Storage Accounts operation. + public partial interface IStorageAccountListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Request URL that can be used to query next page of storage accounts. Returned when total number of requested storage accounts + /// exceed maximum page size. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Request URL that can be used to query next page of storage accounts. Returned when total number of requested storage accounts exceed maximum page size.", + SerializedName = @"nextLink", + PossibleTypes = new [] { typeof(string) })] + string NextLink { get; } + /// Gets the list of storage accounts and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the list of storage accounts and their properties.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount[] Value { get; } + + } + /// The response from the List Storage Accounts operation. + internal partial interface IStorageAccountListResultInternal + + { + /// + /// Request URL that can be used to query next page of storage accounts. Returned when total number of requested storage accounts + /// exceed maximum page size. + /// + string NextLink { get; set; } + /// Gets the list of storage accounts and their properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.json.cs new file mode 100644 index 000000000000..4f33b414c9a2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountListResult.json.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Storage Accounts operation. + public partial class StorageAccountListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccount.FromJson(__u) )) ))() : null : Value;} + {_nextLink = If( json?.PropertyT("nextLink"), out var __jsonNextLink) ? (string)__jsonNextLink : (string)NextLink;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._nextLink)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._nextLink.ToString()) : null, "nextLink" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.PowerShell.cs new file mode 100644 index 000000000000..282357369bdb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.PowerShell.cs @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing + /// endpoint. + /// + [System.ComponentModel.TypeConverter(typeof(StorageAccountMicrosoftEndpointsTypeConverter))] + public partial class StorageAccountMicrosoftEndpoints + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountMicrosoftEndpoints(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountMicrosoftEndpoints(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountMicrosoftEndpoints(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Df, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountMicrosoftEndpoints(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Blob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Blob = (string) content.GetValueForProperty("Blob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Blob, global::System.Convert.ToString); + } + if (content.Contains("Queue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Queue = (string) content.GetValueForProperty("Queue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Queue, global::System.Convert.ToString); + } + if (content.Contains("Table")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Table = (string) content.GetValueForProperty("Table",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Table, global::System.Convert.ToString); + } + if (content.Contains("File")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).File = (string) content.GetValueForProperty("File",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).File, global::System.Convert.ToString); + } + if (content.Contains("Web")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Web = (string) content.GetValueForProperty("Web",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Web, global::System.Convert.ToString); + } + if (content.Contains("Df")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Df = (string) content.GetValueForProperty("Df",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal)this).Df, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing + /// endpoint. + [System.ComponentModel.TypeConverter(typeof(StorageAccountMicrosoftEndpointsTypeConverter))] + public partial interface IStorageAccountMicrosoftEndpoints + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.TypeConverter.cs new file mode 100644 index 000000000000..52ed72ef7ccf --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountMicrosoftEndpointsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountMicrosoftEndpoints.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountMicrosoftEndpoints.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountMicrosoftEndpoints.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.cs new file mode 100644 index 000000000000..fe18c4a41d26 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.cs @@ -0,0 +1,159 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing + /// endpoint. + /// + public partial class StorageAccountMicrosoftEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal + { + + /// Backing field for property. + private string _blob; + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Blob { get => this._blob; } + + /// Backing field for property. + private string _df; + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Df { get => this._df; } + + /// Backing field for property. + private string _file; + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string File { get => this._file; } + + /// Internal Acessors for Blob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal.Blob { get => this._blob; set { {_blob = value;} } } + + /// Internal Acessors for Df + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal.Df { get => this._df; set { {_df = value;} } } + + /// Internal Acessors for File + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal.File { get => this._file; set { {_file = value;} } } + + /// Internal Acessors for Queue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal.Queue { get => this._queue; set { {_queue = value;} } } + + /// Internal Acessors for Table + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal.Table { get => this._table; set { {_table = value;} } } + + /// Internal Acessors for Web + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpointsInternal.Web { get => this._web; set { {_web = value;} } } + + /// Backing field for property. + private string _queue; + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Queue { get => this._queue; } + + /// Backing field for property. + private string _table; + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Table { get => this._table; } + + /// Backing field for property. + private string _web; + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Web { get => this._web; } + + /// Creates an new instance. + public StorageAccountMicrosoftEndpoints() + { + + } + } + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing + /// endpoint. + public partial interface IStorageAccountMicrosoftEndpoints : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string Blob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string Df { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string File { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string Queue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string Table { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string Web { get; } + + } + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing + /// endpoint. + internal partial interface IStorageAccountMicrosoftEndpointsInternal + + { + /// Gets the blob endpoint. + string Blob { get; set; } + /// Gets the dfs endpoint. + string Df { get; set; } + /// Gets the file endpoint. + string File { get; set; } + /// Gets the queue endpoint. + string Queue { get; set; } + /// Gets the table endpoint. + string Table { get; set; } + /// Gets the web endpoint. + string Web { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.json.cs new file mode 100644 index 000000000000..2826fb7c15e8 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountMicrosoftEndpoints.json.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The URIs that are used to perform a retrieval of a public blob, queue, table, web or dfs object via a microsoft routing + /// endpoint. + /// + public partial class StorageAccountMicrosoftEndpoints + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountMicrosoftEndpoints(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountMicrosoftEndpoints(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_blob = If( json?.PropertyT("blob"), out var __jsonBlob) ? (string)__jsonBlob : (string)Blob;} + {_queue = If( json?.PropertyT("queue"), out var __jsonQueue) ? (string)__jsonQueue : (string)Queue;} + {_table = If( json?.PropertyT("table"), out var __jsonTable) ? (string)__jsonTable : (string)Table;} + {_file = If( json?.PropertyT("file"), out var __jsonFile) ? (string)__jsonFile : (string)File;} + {_web = If( json?.PropertyT("web"), out var __jsonWeb) ? (string)__jsonWeb : (string)Web;} + {_df = If( json?.PropertyT("dfs"), out var __jsonDfs) ? (string)__jsonDfs : (string)Df;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._blob)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._blob.ToString()) : null, "blob" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._queue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._queue.ToString()) : null, "queue" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._table)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._table.ToString()) : null, "table" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._file)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._file.ToString()) : null, "file" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._web)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._web.ToString()) : null, "web" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._df)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._df.ToString()) : null, "dfs" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.PowerShell.cs new file mode 100644 index 000000000000..141b06e9da05 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.PowerShell.cs @@ -0,0 +1,1080 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesTypeConverter))] + public partial class StorageAccountProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrimaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus) content.GetValueForProperty("BlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("StorageAccountSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LastGeoFailoverTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SecondaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey1, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyCreationTimeKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey2, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatLastSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("GeoReplicationStatCanFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("BlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StorageAccountSkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("StorageAccountSkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("StorageAccountSkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("StorageAccountSkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterTimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterBlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrimaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("PrimaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyCreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTime = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime) content.GetValueForProperty("KeyCreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTime, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTimeTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints) content.GetValueForProperty("SecondaryEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("GeoReplicationStat")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStat = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats) content.GetValueForProperty("GeoReplicationStat",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStat, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStatsTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus) content.GetValueForProperty("BlobRestoreStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("StorageAccountSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus) content.GetValueForProperty("StorageAccountSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatusTypeConverter.ConvertFrom); + } + if (content.Contains("ProvisioningState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ProvisioningState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState?) content.GetValueForProperty("ProvisioningState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ProvisioningState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState.CreateFrom); + } + if (content.Contains("PrimaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryLocation = (string) content.GetValueForProperty("PrimaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfPrimary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfPrimary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfPrimary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfPrimary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("LastGeoFailoverTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LastGeoFailoverTime = (global::System.DateTime?) content.GetValueForProperty("LastGeoFailoverTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LastGeoFailoverTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("SecondaryLocation")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryLocation = (string) content.GetValueForProperty("SecondaryLocation",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryLocation, global::System.Convert.ToString); + } + if (content.Contains("StatusOfSecondary")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfSecondary = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus?) content.GetValueForProperty("StatusOfSecondary",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StatusOfSecondary, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus.CreateFrom); + } + if (content.Contains("CreationTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CreationTime = (global::System.DateTime?) content.GetValueForProperty("CreationTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CreationTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("FailoverInProgress")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).FailoverInProgress = (bool?) content.GetValueForProperty("FailoverInProgress",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).FailoverInProgress, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("PrivateEndpointConnection")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[]) content.GetValueForProperty("PrivateEndpointConnection",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrivateEndpointConnection, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionTypeConverter.ConvertFrom)); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("KeyCreationTimeKey1")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey1 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey1",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey1, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("KeyCreationTimeKey2")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey2 = (global::System.DateTime?) content.GetValueForProperty("KeyCreationTimeKey2",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyCreationTimeKey2, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("BlobRestoreStatusFailureReason")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason = (string) content.GetValueForProperty("BlobRestoreStatusFailureReason",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusFailureReason, global::System.Convert.ToString); + } + if (content.Contains("BlobRestoreStatusRestoreId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId = (string) content.GetValueForProperty("BlobRestoreStatusRestoreId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusRestoreId, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusStartTime, global::System.Convert.ToString); + } + if (content.Contains("StorageAccountSkuConversionStatusEndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime = (string) content.GetValueForProperty("StorageAccountSkuConversionStatusEndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusEndTime, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("PrimaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("PrimaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("PrimaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob = (string) content.GetValueForProperty("PrimaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue = (string) content.GetValueForProperty("PrimaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable = (string) content.GetValueForProperty("PrimaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile = (string) content.GetValueForProperty("PrimaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb = (string) content.GetValueForProperty("PrimaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf = (string) content.GetValueForProperty("PrimaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("SecondaryEndpointMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints) content.GetValueForProperty("SecondaryEndpointMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointMicrosoftEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountMicrosoftEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints) content.GetValueForProperty("SecondaryEndpointInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointInternetEndpoint, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountInternetEndpointsTypeConverter.ConvertFrom); + } + if (content.Contains("SecondaryEndpointBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob = (string) content.GetValueForProperty("SecondaryEndpointBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue = (string) content.GetValueForProperty("SecondaryEndpointQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable = (string) content.GetValueForProperty("SecondaryEndpointTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile = (string) content.GetValueForProperty("SecondaryEndpointFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb = (string) content.GetValueForProperty("SecondaryEndpointWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf = (string) content.GetValueForProperty("SecondaryEndpointDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointDf, global::System.Convert.ToString); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("GeoReplicationStatStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus?) content.GetValueForProperty("GeoReplicationStatStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus.CreateFrom); + } + if (content.Contains("GeoReplicationStatLastSyncTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatLastSyncTime = (global::System.DateTime?) content.GetValueForProperty("GeoReplicationStatLastSyncTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatLastSyncTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("GeoReplicationStatCanFailover")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover = (bool?) content.GetValueForProperty("GeoReplicationStatCanFailover",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).GeoReplicationStatCanFailover, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("BlobRestoreStatusParameter")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) content.GetValueForProperty("BlobRestoreStatusParameter",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusParameter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParametersTypeConverter.ConvertFrom); + } + if (content.Contains("BlobRestoreStatusStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus?) content.GetValueForProperty("BlobRestoreStatusStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).BlobRestoreStatusStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus.CreateFrom); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("StorageAccountSkuConversionStatusSkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("StorageAccountSkuConversionStatusSkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusSkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("StorageAccountSkuConversionStatusTargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("StorageAccountSkuConversionStatusTargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).StorageAccountSkuConversionStatusTargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("PrimaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("PrimaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).PrimaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsQueue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsQueue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsQueue, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsTable")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsTable",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsTable, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsMicrosoftEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsMicrosoftEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsMicrosoftEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsBlob")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsBlob",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsBlob, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsFile")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsFile",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsFile, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsWeb")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsWeb",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsWeb, global::System.Convert.ToString); + } + if (content.Contains("SecondaryEndpointsInternetEndpointsDf")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf = (string) content.GetValueForProperty("SecondaryEndpointsInternetEndpointsDf",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).SecondaryEndpointsInternetEndpointsDf, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ParameterTimeToRestore")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterTimeToRestore = (global::System.DateTime) content.GetValueForProperty("ParameterTimeToRestore",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterTimeToRestore, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ParameterBlobRange")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterBlobRange = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[]) content.GetValueForProperty("ParameterBlobRange",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ParameterBlobRange, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreRangeTypeConverter.ConvertFrom)); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesTypeConverter))] + public partial interface IStorageAccountProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.TypeConverter.cs new file mode 100644 index 000000000000..ba220f5a411d --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountPropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.cs new file mode 100644 index 000000000000..022df1511da4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.cs @@ -0,0 +1,2136 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the storage account. + public partial class StorageAccountProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? _accessTier; + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get => this._accessTier; } + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); } + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyAzureStorageSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid = value ?? null; } + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid = value ?? null; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName = value ?? null; } + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid = value ?? null; } + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyForestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName = value ?? null; } + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyNetBiosDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName = value ?? null; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertySamAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// Backing field for property. + private bool? _allowBlobPublicAccess; + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowBlobPublicAccess { get => this._allowBlobPublicAccess; set => this._allowBlobPublicAccess = value; } + + /// Backing field for property. + private bool? _allowCrossTenantReplication; + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowCrossTenantReplication { get => this._allowCrossTenantReplication; set => this._allowCrossTenantReplication = value; } + + /// Backing field for property. + private bool? _allowSharedKeyAccess; + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowSharedKeyAccess { get => this._allowSharedKeyAccess; set => this._allowSharedKeyAccess = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? _allowedCopyScope; + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get => this._allowedCopyScope; set => this._allowedCopyScope = value; } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication _azureFilesIdentityBasedAuthentication; + + /// Provides the identity based authentication settings for Azure Files. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication()); set => this._azureFilesIdentityBasedAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus _blobRestoreStatus; + + /// Blob restore status + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus BlobRestoreStatus { get => (this._blobRestoreStatus = this._blobRestoreStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatus()); } + + /// Failure reason when blob restore is failed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string BlobRestoreStatusFailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).FailureReason; } + + /// Id for tracking blob restore request. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string BlobRestoreStatusRestoreId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).RestoreId; } + + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? BlobRestoreStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).Status; } + + /// Backing field for property. + private global::System.DateTime? _creationTime; + + /// Gets the creation date and time of the storage account in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? CreationTime { get => this._creationTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain _customDomain; + + /// Gets the custom domain the user assigned to this storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain()); } + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string CustomDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).Name = value ?? null; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? CustomDomainUseSubDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).UseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).UseSubDomainName = value ?? default(bool); } + + /// Backing field for property. + private bool? _defaultToOAuthAuthentication; + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? DefaultToOAuthAuthentication { get => this._defaultToOAuthAuthentication; set => this._defaultToOAuthAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? _dnsEndpointType; + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get => this._dnsEndpointType; set => this._dnsEndpointType = value; } + + /// Backing field for property. + private bool? _enableHttpsTrafficOnly; + + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableHttpsTrafficOnly { get => this._enableHttpsTrafficOnly; set => this._enableHttpsTrafficOnly = value; } + + /// Backing field for property. + private bool? _enableNfsV3; + + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableNfsV3 { get => this._enableNfsV3; set => this._enableNfsV3 = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption _encryption; + + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption()); } + + /// Backing field for property. + private bool? _failoverInProgress; + + /// + /// If the failover is in progress, the value will be true, otherwise, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? FailoverInProgress { get => this._failoverInProgress; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats _geoReplicationStat; + + /// Geo Replication Stats + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats GeoReplicationStat { get => (this._geoReplicationStat = this._geoReplicationStat ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStats()); } + + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? GeoReplicationStatCanFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).CanFailover; } + + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? GeoReplicationStatLastSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).LastSyncTime; } + + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? GeoReplicationStatStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).Status; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutabilityPolicyAllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount _immutableStorageWithVersioning; + + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the containers in the account by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount()); set => this._immutableStorageWithVersioning = value; } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled = value ?? default(bool); } + + /// Backing field for property. + private bool? _isHnsEnabled; + + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsHnsEnabled { get => this._isHnsEnabled; set => this._isHnsEnabled = value; } + + /// Backing field for property. + private bool? _isLocalUserEnabled; + + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsLocalUserEnabled { get => this._isLocalUserEnabled; set => this._isLocalUserEnabled = value; } + + /// Backing field for property. + private bool? _isSftpEnabled; + + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsSftpEnabled { get => this._isSftpEnabled; set => this._isSftpEnabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime _keyCreationTime; + + /// Storage account keys creation time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime KeyCreationTime { get => (this._keyCreationTime = this._keyCreationTime ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTime()); } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyCreationTimeKey1 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)KeyCreationTime).Key1; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)KeyCreationTime).Key1 = value ?? default(global::System.DateTime); } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? KeyCreationTimeKey2 { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)KeyCreationTime).Key2; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTimeInternal)KeyCreationTime).Key2 = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy _keyPolicy; + + /// KeyPolicy assigned to the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy()); } + + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? KeyPolicyKeyExpirationPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? _largeFileSharesState; + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get => this._largeFileSharesState; set => this._largeFileSharesState = value; } + + /// Backing field for property. + private global::System.DateTime? _lastGeoFailoverTime; + + /// + /// Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp + /// is retained. This element is not returned if there has never been a failover instance. Only available if the accountType + /// is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? LastGeoFailoverTime { get => this._lastGeoFailoverTime; } + + /// Internal Acessors for AccessTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.AccessTier { get => this._accessTier; set { {_accessTier = value;} } } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication()); set { {_azureFilesIdentityBasedAuthentication = value;} } } + + /// Internal Acessors for BlobRestoreStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.BlobRestoreStatus { get => (this._blobRestoreStatus = this._blobRestoreStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatus()); set { {_blobRestoreStatus = value;} } } + + /// Internal Acessors for BlobRestoreStatusFailureReason + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.BlobRestoreStatusFailureReason { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).FailureReason; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).FailureReason = value; } + + /// Internal Acessors for BlobRestoreStatusParameter + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.BlobRestoreStatusParameter { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).Parameter; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).Parameter = value; } + + /// Internal Acessors for BlobRestoreStatusRestoreId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.BlobRestoreStatusRestoreId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).RestoreId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).RestoreId = value; } + + /// Internal Acessors for BlobRestoreStatusStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.BlobRestoreStatusStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).Status = value; } + + /// Internal Acessors for CreationTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.CreationTime { get => this._creationTime; set { {_creationTime = value;} } } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain()); set { {_customDomain = value;} } } + + /// Internal Acessors for Encryption + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption()); set { {_encryption = value;} } } + + /// Internal Acessors for FailoverInProgress + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.FailoverInProgress { get => this._failoverInProgress; set { {_failoverInProgress = value;} } } + + /// Internal Acessors for GeoReplicationStat + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.GeoReplicationStat { get => (this._geoReplicationStat = this._geoReplicationStat ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStats()); set { {_geoReplicationStat = value;} } } + + /// Internal Acessors for GeoReplicationStatCanFailover + bool? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.GeoReplicationStatCanFailover { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).CanFailover; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).CanFailover = value; } + + /// Internal Acessors for GeoReplicationStatLastSyncTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.GeoReplicationStatLastSyncTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).LastSyncTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).LastSyncTime = value; } + + /// Internal Acessors for GeoReplicationStatStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.GeoReplicationStatStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).Status; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStatsInternal)GeoReplicationStat).Status = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy = value; } + + /// Internal Acessors for KeyCreationTime + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.KeyCreationTime { get => (this._keyCreationTime = this._keyCreationTime ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTime()); set { {_keyCreationTime = value;} } } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy()); set { {_keyPolicy = value;} } } + + /// Internal Acessors for LastGeoFailoverTime + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.LastGeoFailoverTime { get => this._lastGeoFailoverTime; set { {_lastGeoFailoverTime = value;} } } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet()); set { {_networkRuleSet = value;} } } + + /// Internal Acessors for PrimaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpoint { get => (this._primaryEndpoint = this._primaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints()); set { {_primaryEndpoint = value;} } } + + /// Internal Acessors for PrimaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Blob = value; } + + /// Internal Acessors for PrimaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Df = value; } + + /// Internal Acessors for PrimaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).File = value; } + + /// Internal Acessors for PrimaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpoint = value; } + + /// Internal Acessors for PrimaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Queue = value; } + + /// Internal Acessors for PrimaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Table = value; } + + /// Internal Acessors for PrimaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Web = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointBlob = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointDf = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointFile = value; } + + /// Internal Acessors for PrimaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointWeb = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointBlob = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointDf = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointFile = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointQueue = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointTable = value; } + + /// Internal Acessors for PrimaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointWeb = value; } + + /// Internal Acessors for PrimaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrimaryLocation { get => this._primaryLocation; set { {_primaryLocation = value;} } } + + /// Internal Acessors for PrivateEndpointConnection + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.PrivateEndpointConnection { get => this._privateEndpointConnection; set { {_privateEndpointConnection = value;} } } + + /// Internal Acessors for ProvisioningState + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.ProvisioningState { get => this._provisioningState; set { {_provisioningState = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference()); set { {_routingPreference = value;} } } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy()); set { {_sasPolicy = value;} } } + + /// Internal Acessors for SasPolicyExpirationAction + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction = value; } + + /// Internal Acessors for SecondaryEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpoint { get => (this._secondaryEndpoint = this._secondaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints()); set { {_secondaryEndpoint = value;} } } + + /// Internal Acessors for SecondaryEndpointBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Blob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Blob = value; } + + /// Internal Acessors for SecondaryEndpointDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Df; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Df = value; } + + /// Internal Acessors for SecondaryEndpointFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).File; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).File = value; } + + /// Internal Acessors for SecondaryEndpointInternetEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointMicrosoftEndpoint + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpoint = value; } + + /// Internal Acessors for SecondaryEndpointQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Queue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Queue = value; } + + /// Internal Acessors for SecondaryEndpointTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Table; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Table = value; } + + /// Internal Acessors for SecondaryEndpointWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Web; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Web = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointBlob = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointDf = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointFile = value; } + + /// Internal Acessors for SecondaryEndpointsInternetEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointWeb = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsBlob + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointBlob; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointBlob = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsDf + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointDf; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointDf = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsFile + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointFile; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointFile = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsQueue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointQueue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointQueue = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsTable + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointTable; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointTable = value; } + + /// Internal Acessors for SecondaryEndpointsMicrosoftEndpointsWeb + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointWeb; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointWeb = value; } + + /// Internal Acessors for SecondaryLocation + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.SecondaryLocation { get => this._secondaryLocation; set { {_secondaryLocation = value;} } } + + /// Internal Acessors for StatusOfPrimary + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.StatusOfPrimary { get => this._statusOfPrimary; set { {_statusOfPrimary = value;} } } + + /// Internal Acessors for StatusOfSecondary + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.StatusOfSecondary { get => this._statusOfSecondary; set { {_statusOfSecondary = value;} } } + + /// Internal Acessors for StorageAccountSkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatus { get => (this._storageAccountSkuConversionStatus = this._storageAccountSkuConversionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatus()); set { {_storageAccountSkuConversionStatus = value;} } } + + /// Internal Acessors for StorageAccountSkuConversionStatusEndTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatusEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).EndTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).EndTime = value; } + + /// Internal Acessors for StorageAccountSkuConversionStatusSkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatusSkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).SkuConversionStatus; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).SkuConversionStatus = value; } + + /// Internal Acessors for StorageAccountSkuConversionStatusStartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesInternal.StorageAccountSkuConversionStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).StartTime = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? _minimumTlsVersion; + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get => this._minimumTlsVersion; set => this._minimumTlsVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet _networkRuleSet; + + /// Network rule set + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet()); } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).Bypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).Bypass = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); } + + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); } + + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).IPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).IPRule = value ?? null /* arrayOf */; } + + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule = value ?? null /* arrayOf */; } + + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).ParameterBlobRange; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).ParameterBlobRange = value ?? null /* arrayOf */; } + + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? ParameterTimeToRestore { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).ParameterTimeToRestore; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatusInternal)BlobRestoreStatus).ParameterTimeToRestore = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints _primaryEndpoint; + + /// + /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and + /// Premium_LRS accounts only return the blob endpoint. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints PrimaryEndpoint { get => (this._primaryEndpoint = this._primaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints()); } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Blob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Df; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).File; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Queue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Table; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).Web; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointFile; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).InternetEndpointWeb; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointFile; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointQueue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointTable; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PrimaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)PrimaryEndpoint).MicrosoftEndpointWeb; } + + /// Backing field for property. + private string _primaryLocation; + + /// Gets the location of the primary data center for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PrimaryLocation { get => this._primaryLocation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] _privateEndpointConnection; + + /// + /// List of private endpoint connection associated with the specified storage account + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] PrivateEndpointConnection { get => this._privateEndpointConnection; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? _provisioningState; + + /// Gets the status of the storage account at the time the operation was called. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get => this._provisioningState; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference _routingPreference; + + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference()); set => this._routingPreference = value; } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint = value ?? default(bool); } + + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy _sasPolicy; + + /// SasPolicy assigned to the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy()); } + + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction; } + + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicySasExpirationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints _secondaryEndpoint; + + /// + /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location + /// of the storage account. Only available if the SKU name is Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints SecondaryEndpoint { get => (this._secondaryEndpoint = this._secondaryEndpoint ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints()); } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Blob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Df; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).File; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Queue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Table; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).Web; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointFile; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsInternetEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).InternetEndpointWeb; } + + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsBlob { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointBlob; } + + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsDf { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointDf; } + + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsFile { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointFile; } + + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsQueue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointQueue; } + + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsTable { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointTable; } + + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SecondaryEndpointsMicrosoftEndpointsWeb { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpointsInternal)SecondaryEndpoint).MicrosoftEndpointWeb; } + + /// Backing field for property. + private string _secondaryLocation; + + /// + /// Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS + /// or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SecondaryLocation { get => this._secondaryLocation; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? _statusOfPrimary; + + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfPrimary { get => this._statusOfPrimary; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? _statusOfSecondary; + + /// + /// Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available + /// if the SKU name is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfSecondary { get => this._statusOfSecondary; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus _storageAccountSkuConversionStatus; + + /// + /// This property is readOnly and is set by server during asynchronous storage account sku conversion operations. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus StorageAccountSkuConversionStatus { get => (this._storageAccountSkuConversionStatus = this._storageAccountSkuConversionStatus ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatus()); set => this._storageAccountSkuConversionStatus = value; } + + /// This property represents the sku conversion end time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string StorageAccountSkuConversionStatusEndTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).EndTime; } + + /// This property indicates the current sku conversion status. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? StorageAccountSkuConversionStatusSkuConversionStatus { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).SkuConversionStatus; } + + /// This property represents the sku conversion start time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string StorageAccountSkuConversionStatusStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).StartTime; } + + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? StorageAccountSkuConversionStatusTargetSkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).TargetSkuName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)StorageAccountSkuConversionStatus).TargetSkuName = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); } + + /// Creates an new instance. + public StorageAccountProperties() + { + + } + } + /// Properties of the storage account. + public partial interface IStorageAccountProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; } + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Failure reason when blob restore is failed. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Failure reason when blob restore is failed.", + SerializedName = @"failureReason", + PossibleTypes = new [] { typeof(string) })] + string BlobRestoreStatusFailureReason { get; } + /// Id for tracking blob restore request. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Id for tracking blob restore request.", + SerializedName = @"restoreId", + PossibleTypes = new [] { typeof(string) })] + string BlobRestoreStatusRestoreId { get; } + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? BlobRestoreStatusStatus { get; } + /// Gets the creation date and time of the storage account in UTC. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the creation date and time of the storage account in UTC.", + SerializedName = @"creationTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? CreationTime { get; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(bool) })] + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(bool) })] + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NFS 3.0 protocol support enabled if set to true.", + SerializedName = @"isNfsV3Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Encryption settings to be used for server-side encryption for the storage account.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; } + /// + /// If the failover is in progress, the value will be true, otherwise, it will be null. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"If the failover is in progress, the value will be true, otherwise, it will be null.", + SerializedName = @"failoverInProgress", + PossibleTypes = new [] { typeof(bool) })] + bool? FailoverInProgress { get; } + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"A boolean flag which indicates whether or not account failover is supported for the account.", + SerializedName = @"canFailover", + PossibleTypes = new [] { typeof(bool) })] + bool? GeoReplicationStatCanFailover { get; } + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime is not available, this can happen if secondary is offline or we are in bootstrap.", + SerializedName = @"lastSyncTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? GeoReplicationStatLastSyncTime { get; } + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location is temporarily unavailable.", + SerializedName = @"status", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? GeoReplicationStatStatus { get; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account HierarchicalNamespace enabled if sets to true.", + SerializedName = @"isHnsEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSftpEnabled { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"key1", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyCreationTimeKey1 { get; set; } + + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"", + SerializedName = @"key2", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? KeyCreationTimeKey2 { get; set; } + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp + /// is retained. This element is not returned if there has never been a failover instance. Only available if the accountType + /// is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp is retained. This element is not returned if there has never been a failover instance. Only available if the accountType is Standard_GRS or Standard_RAGRS.", + SerializedName = @"lastGeoFailoverTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? LastGeoFailoverTime { get; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// Blob ranges to restore. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Blob ranges to restore.", + SerializedName = @"blobRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get; set; } + /// Restore blob to the specified time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restore blob to the specified time.", + SerializedName = @"timeToRestore", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ParameterTimeToRestore { get; set; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsFile { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsInternetEndpointsWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string PrimaryEndpointsMicrosoftEndpointsWeb { get; } + /// Gets the location of the primary data center for the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the location of the primary data center for the storage account.", + SerializedName = @"primaryLocation", + PossibleTypes = new [] { typeof(string) })] + string PrimaryLocation { get; } + /// + /// List of private endpoint connection associated with the specified storage account + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"List of private endpoint connection associated with the specified storage account", + SerializedName = @"privateEndpointConnections", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] PrivateEndpointConnection { get; } + /// Gets the status of the storage account at the time the operation was called. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the status of the storage account at the time the operation was called.", + SerializedName = @"provisioningState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SAS expiration action. Can only be Log.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(string) })] + string SasPolicyExpirationAction { get; } + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + string SasPolicySasExpirationPeriod { get; set; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsFile { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsInternetEndpointsWeb { get; } + /// Gets the blob endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the blob endpoint.", + SerializedName = @"blob", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsBlob { get; } + /// Gets the dfs endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the dfs endpoint.", + SerializedName = @"dfs", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsDf { get; } + /// Gets the file endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the file endpoint.", + SerializedName = @"file", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsFile { get; } + /// Gets the queue endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the queue endpoint.", + SerializedName = @"queue", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsQueue { get; } + /// Gets the table endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the table endpoint.", + SerializedName = @"table", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsTable { get; } + /// Gets the web endpoint. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the web endpoint.", + SerializedName = @"web", + PossibleTypes = new [] { typeof(string) })] + string SecondaryEndpointsMicrosoftEndpointsWeb { get; } + /// + /// Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS + /// or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS or Standard_RAGRS.", + SerializedName = @"secondaryLocation", + PossibleTypes = new [] { typeof(string) })] + string SecondaryLocation { get; } + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the status indicating whether the primary location of the storage account is available or unavailable.", + SerializedName = @"statusOfPrimary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfPrimary { get; } + /// + /// Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available + /// if the SKU name is Standard_GRS or Standard_RAGRS. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available if the SKU name is Standard_GRS or Standard_RAGRS.", + SerializedName = @"statusOfSecondary", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfSecondary { get; } + /// This property represents the sku conversion end time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property represents the sku conversion end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountSkuConversionStatusEndTime { get; } + /// This property indicates the current sku conversion status. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property indicates the current sku conversion status.", + SerializedName = @"skuConversionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? StorageAccountSkuConversionStatusSkuConversionStatus { get; } + /// This property represents the sku conversion start time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property represents the sku conversion start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string StorageAccountSkuConversionStatusStartTime { get; } + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property represents the target sku name to which the account sku is being converted asynchronously.", + SerializedName = @"targetSkuName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? StorageAccountSkuConversionStatusTargetSkuName { get; set; } + + } + /// Properties of the storage account. + internal partial interface IStorageAccountPropertiesInternal + + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Provides the identity based authentication settings for Azure Files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; } + /// Blob restore status + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus BlobRestoreStatus { get; set; } + /// Failure reason when blob restore is failed. + string BlobRestoreStatusFailureReason { get; set; } + /// Blob restore request parameters. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters BlobRestoreStatusParameter { get; set; } + /// Id for tracking blob restore request. + string BlobRestoreStatusRestoreId { get; set; } + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus? BlobRestoreStatusStatus { get; set; } + /// Gets the creation date and time of the storage account in UTC. + global::System.DateTime? CreationTime { get; set; } + /// Gets the custom domain the user assigned to this storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// + /// If the failover is in progress, the value will be true, otherwise, it will be null. + /// + bool? FailoverInProgress { get; set; } + /// Geo Replication Stats + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IGeoReplicationStats GeoReplicationStat { get; set; } + /// + /// A boolean flag which indicates whether or not account failover is supported for the account. + /// + bool? GeoReplicationStatCanFailover { get; set; } + /// + /// All primary writes preceding this UTC date/time value are guaranteed to be available for read operations. Primary writes + /// following this point in time may or may not be available for reads. Element may be default value if value of LastSyncTime + /// is not available, this can happen if secondary is offline or we are in bootstrap. + /// + global::System.DateTime? GeoReplicationStatLastSyncTime { get; set; } + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus? GeoReplicationStatStatus { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the containers in the account by default. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutableStorageWithVersioningImmutabilityPolicy { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + bool? IsSftpEnabled { get; set; } + /// Storage account keys creation time. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyCreationTime KeyCreationTime { get; set; } + + global::System.DateTime? KeyCreationTimeKey1 { get; set; } + + global::System.DateTime? KeyCreationTimeKey2 { get; set; } + /// KeyPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get; set; } + /// The key expiration period in days. + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Gets the timestamp of the most recent instance of a failover to the secondary location. Only the most recent timestamp + /// is retained. This element is not returned if there has never been a failover instance. Only available if the accountType + /// is Standard_GRS or Standard_RAGRS. + /// + global::System.DateTime? LastGeoFailoverTime { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// Network rule set + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// Blob ranges to restore. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] ParameterBlobRange { get; set; } + /// Restore blob to the specified time. + global::System.DateTime? ParameterTimeToRestore { get; set; } + /// + /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object. Note that Standard_ZRS and + /// Premium_LRS accounts only return the blob endpoint. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints PrimaryEndpoint { get; set; } + /// Gets the blob endpoint. + string PrimaryEndpointBlob { get; set; } + /// Gets the dfs endpoint. + string PrimaryEndpointDf { get; set; } + /// Gets the file endpoint. + string PrimaryEndpointFile { get; set; } + /// Gets the internet routing storage endpoints + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints PrimaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints PrimaryEndpointMicrosoftEndpoint { get; set; } + /// Gets the queue endpoint. + string PrimaryEndpointQueue { get; set; } + /// Gets the table endpoint. + string PrimaryEndpointTable { get; set; } + /// Gets the web endpoint. + string PrimaryEndpointWeb { get; set; } + /// Gets the blob endpoint. + string PrimaryEndpointsInternetEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string PrimaryEndpointsInternetEndpointsDf { get; set; } + /// Gets the file endpoint. + string PrimaryEndpointsInternetEndpointsFile { get; set; } + /// Gets the web endpoint. + string PrimaryEndpointsInternetEndpointsWeb { get; set; } + /// Gets the blob endpoint. + string PrimaryEndpointsMicrosoftEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string PrimaryEndpointsMicrosoftEndpointsDf { get; set; } + /// Gets the file endpoint. + string PrimaryEndpointsMicrosoftEndpointsFile { get; set; } + /// Gets the queue endpoint. + string PrimaryEndpointsMicrosoftEndpointsQueue { get; set; } + /// Gets the table endpoint. + string PrimaryEndpointsMicrosoftEndpointsTable { get; set; } + /// Gets the web endpoint. + string PrimaryEndpointsMicrosoftEndpointsWeb { get; set; } + /// Gets the location of the primary data center for the storage account. + string PrimaryLocation { get; set; } + /// + /// List of private endpoint connection associated with the specified storage account + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection[] PrivateEndpointConnection { get; set; } + /// Gets the status of the storage account at the time the operation was called. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState? ProvisioningState { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// SasPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get; set; } + /// The SAS expiration action. Can only be Log. + string SasPolicyExpirationAction { get; set; } + /// The SAS expiration period, DD.HH:MM:SS. + string SasPolicySasExpirationPeriod { get; set; } + /// + /// Gets the URLs that are used to perform a retrieval of a public blob, queue, or table object from the secondary location + /// of the storage account. Only available if the SKU name is Standard_RAGRS. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEndpoints SecondaryEndpoint { get; set; } + /// Gets the blob endpoint. + string SecondaryEndpointBlob { get; set; } + /// Gets the dfs endpoint. + string SecondaryEndpointDf { get; set; } + /// Gets the file endpoint. + string SecondaryEndpointFile { get; set; } + /// Gets the internet routing storage endpoints + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountInternetEndpoints SecondaryEndpointInternetEndpoint { get; set; } + /// Gets the microsoft routing storage endpoints. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountMicrosoftEndpoints SecondaryEndpointMicrosoftEndpoint { get; set; } + /// Gets the queue endpoint. + string SecondaryEndpointQueue { get; set; } + /// Gets the table endpoint. + string SecondaryEndpointTable { get; set; } + /// Gets the web endpoint. + string SecondaryEndpointWeb { get; set; } + /// Gets the blob endpoint. + string SecondaryEndpointsInternetEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string SecondaryEndpointsInternetEndpointsDf { get; set; } + /// Gets the file endpoint. + string SecondaryEndpointsInternetEndpointsFile { get; set; } + /// Gets the web endpoint. + string SecondaryEndpointsInternetEndpointsWeb { get; set; } + /// Gets the blob endpoint. + string SecondaryEndpointsMicrosoftEndpointsBlob { get; set; } + /// Gets the dfs endpoint. + string SecondaryEndpointsMicrosoftEndpointsDf { get; set; } + /// Gets the file endpoint. + string SecondaryEndpointsMicrosoftEndpointsFile { get; set; } + /// Gets the queue endpoint. + string SecondaryEndpointsMicrosoftEndpointsQueue { get; set; } + /// Gets the table endpoint. + string SecondaryEndpointsMicrosoftEndpointsTable { get; set; } + /// Gets the web endpoint. + string SecondaryEndpointsMicrosoftEndpointsWeb { get; set; } + /// + /// Gets the location of the geo-replicated secondary for the storage account. Only available if the accountType is Standard_GRS + /// or Standard_RAGRS. + /// + string SecondaryLocation { get; set; } + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfPrimary { get; set; } + /// + /// Gets the status indicating whether the secondary location of the storage account is available or unavailable. Only available + /// if the SKU name is Standard_GRS or Standard_RAGRS. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus? StatusOfSecondary { get; set; } + /// + /// This property is readOnly and is set by server during asynchronous storage account sku conversion operations. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus StorageAccountSkuConversionStatus { get; set; } + /// This property represents the sku conversion end time. + string StorageAccountSkuConversionStatusEndTime { get; set; } + /// This property indicates the current sku conversion status. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? StorageAccountSkuConversionStatusSkuConversionStatus { get; set; } + /// This property represents the sku conversion start time. + string StorageAccountSkuConversionStatusStartTime { get; set; } + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? StorageAccountSkuConversionStatusTargetSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.json.cs new file mode 100644 index 000000000000..ef213d09d123 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountProperties.json.cs @@ -0,0 +1,250 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the storage account. + public partial class StorageAccountProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_primaryEndpoint = If( json?.PropertyT("primaryEndpoints"), out var __jsonPrimaryEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints.FromJson(__jsonPrimaryEndpoints) : PrimaryEndpoint;} + {_customDomain = If( json?.PropertyT("customDomain"), out var __jsonCustomDomain) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain.FromJson(__jsonCustomDomain) : CustomDomain;} + {_sasPolicy = If( json?.PropertyT("sasPolicy"), out var __jsonSasPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy.FromJson(__jsonSasPolicy) : SasPolicy;} + {_keyPolicy = If( json?.PropertyT("keyPolicy"), out var __jsonKeyPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy.FromJson(__jsonKeyPolicy) : KeyPolicy;} + {_keyCreationTime = If( json?.PropertyT("keyCreationTime"), out var __jsonKeyCreationTime) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyCreationTime.FromJson(__jsonKeyCreationTime) : KeyCreationTime;} + {_secondaryEndpoint = If( json?.PropertyT("secondaryEndpoints"), out var __jsonSecondaryEndpoints) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Endpoints.FromJson(__jsonSecondaryEndpoints) : SecondaryEndpoint;} + {_azureFilesIdentityBasedAuthentication = If( json?.PropertyT("azureFilesIdentityBasedAuthentication"), out var __jsonAzureFilesIdentityBasedAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication.FromJson(__jsonAzureFilesIdentityBasedAuthentication) : AzureFilesIdentityBasedAuthentication;} + {_networkRuleSet = If( json?.PropertyT("networkAcls"), out var __jsonNetworkAcls) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet.FromJson(__jsonNetworkAcls) : NetworkRuleSet;} + {_geoReplicationStat = If( json?.PropertyT("geoReplicationStats"), out var __jsonGeoReplicationStats) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.GeoReplicationStats.FromJson(__jsonGeoReplicationStats) : GeoReplicationStat;} + {_routingPreference = If( json?.PropertyT("routingPreference"), out var __jsonRoutingPreference) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference.FromJson(__jsonRoutingPreference) : RoutingPreference;} + {_blobRestoreStatus = If( json?.PropertyT("blobRestoreStatus"), out var __jsonBlobRestoreStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatus.FromJson(__jsonBlobRestoreStatus) : BlobRestoreStatus;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount.FromJson(__jsonImmutableStorageWithVersioning) : ImmutableStorageWithVersioning;} + {_storageAccountSkuConversionStatus = If( json?.PropertyT("storageAccountSkuConversionStatus"), out var __jsonStorageAccountSkuConversionStatus) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountSkuConversionStatus.FromJson(__jsonStorageAccountSkuConversionStatus) : StorageAccountSkuConversionStatus;} + {_provisioningState = If( json?.PropertyT("provisioningState"), out var __jsonProvisioningState) ? (string)__jsonProvisioningState : (string)ProvisioningState;} + {_primaryLocation = If( json?.PropertyT("primaryLocation"), out var __jsonPrimaryLocation) ? (string)__jsonPrimaryLocation : (string)PrimaryLocation;} + {_statusOfPrimary = If( json?.PropertyT("statusOfPrimary"), out var __jsonStatusOfPrimary) ? (string)__jsonStatusOfPrimary : (string)StatusOfPrimary;} + {_lastGeoFailoverTime = If( json?.PropertyT("lastGeoFailoverTime"), out var __jsonLastGeoFailoverTime) ? global::System.DateTime.TryParse((string)__jsonLastGeoFailoverTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonLastGeoFailoverTimeValue) ? __jsonLastGeoFailoverTimeValue : LastGeoFailoverTime : LastGeoFailoverTime;} + {_secondaryLocation = If( json?.PropertyT("secondaryLocation"), out var __jsonSecondaryLocation) ? (string)__jsonSecondaryLocation : (string)SecondaryLocation;} + {_statusOfSecondary = If( json?.PropertyT("statusOfSecondary"), out var __jsonStatusOfSecondary) ? (string)__jsonStatusOfSecondary : (string)StatusOfSecondary;} + {_creationTime = If( json?.PropertyT("creationTime"), out var __jsonCreationTime) ? global::System.DateTime.TryParse((string)__jsonCreationTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonCreationTimeValue) ? __jsonCreationTimeValue : CreationTime : CreationTime;} + {_accessTier = If( json?.PropertyT("accessTier"), out var __jsonAccessTier) ? (string)__jsonAccessTier : (string)AccessTier;} + {_enableHttpsTrafficOnly = If( json?.PropertyT("supportsHttpsTrafficOnly"), out var __jsonSupportsHttpsTrafficOnly) ? (bool?)__jsonSupportsHttpsTrafficOnly : EnableHttpsTrafficOnly;} + {_isSftpEnabled = If( json?.PropertyT("isSftpEnabled"), out var __jsonIsSftpEnabled) ? (bool?)__jsonIsSftpEnabled : IsSftpEnabled;} + {_isLocalUserEnabled = If( json?.PropertyT("isLocalUserEnabled"), out var __jsonIsLocalUserEnabled) ? (bool?)__jsonIsLocalUserEnabled : IsLocalUserEnabled;} + {_isHnsEnabled = If( json?.PropertyT("isHnsEnabled"), out var __jsonIsHnsEnabled) ? (bool?)__jsonIsHnsEnabled : IsHnsEnabled;} + {_failoverInProgress = If( json?.PropertyT("failoverInProgress"), out var __jsonFailoverInProgress) ? (bool?)__jsonFailoverInProgress : FailoverInProgress;} + {_largeFileSharesState = If( json?.PropertyT("largeFileSharesState"), out var __jsonLargeFileSharesState) ? (string)__jsonLargeFileSharesState : (string)LargeFileSharesState;} + {_privateEndpointConnection = If( json?.PropertyT("privateEndpointConnections"), out var __jsonPrivateEndpointConnections) ? If( __jsonPrivateEndpointConnections as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnection.FromJson(__u) )) ))() : null : PrivateEndpointConnection;} + {_allowBlobPublicAccess = If( json?.PropertyT("allowBlobPublicAccess"), out var __jsonAllowBlobPublicAccess) ? (bool?)__jsonAllowBlobPublicAccess : AllowBlobPublicAccess;} + {_minimumTlsVersion = If( json?.PropertyT("minimumTlsVersion"), out var __jsonMinimumTlsVersion) ? (string)__jsonMinimumTlsVersion : (string)MinimumTlsVersion;} + {_allowSharedKeyAccess = If( json?.PropertyT("allowSharedKeyAccess"), out var __jsonAllowSharedKeyAccess) ? (bool?)__jsonAllowSharedKeyAccess : AllowSharedKeyAccess;} + {_enableNfsV3 = If( json?.PropertyT("isNfsV3Enabled"), out var __jsonIsNfsV3Enabled) ? (bool?)__jsonIsNfsV3Enabled : EnableNfsV3;} + {_allowCrossTenantReplication = If( json?.PropertyT("allowCrossTenantReplication"), out var __jsonAllowCrossTenantReplication) ? (bool?)__jsonAllowCrossTenantReplication : AllowCrossTenantReplication;} + {_defaultToOAuthAuthentication = If( json?.PropertyT("defaultToOAuthAuthentication"), out var __jsonDefaultToOAuthAuthentication) ? (bool?)__jsonDefaultToOAuthAuthentication : DefaultToOAuthAuthentication;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_allowedCopyScope = If( json?.PropertyT("allowedCopyScope"), out var __jsonAllowedCopyScope) ? (string)__jsonAllowedCopyScope : (string)AllowedCopyScope;} + {_dnsEndpointType = If( json?.PropertyT("dnsEndpointType"), out var __jsonDnsEndpointType) ? (string)__jsonDnsEndpointType : (string)DnsEndpointType;} + {_encryption = If( json?.PropertyT("encryption"), out var __jsonEncryption) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption.FromJson(__jsonEncryption) : Encryption;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._primaryEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._primaryEndpoint.ToJson(null,serializationMode) : null, "primaryEndpoints" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._customDomain ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._customDomain.ToJson(null,serializationMode) : null, "customDomain" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._sasPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sasPolicy.ToJson(null,serializationMode) : null, "sasPolicy" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._keyPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._keyPolicy.ToJson(null,serializationMode) : null, "keyPolicy" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._keyCreationTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._keyCreationTime.ToJson(null,serializationMode) : null, "keyCreationTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._secondaryEndpoint ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._secondaryEndpoint.ToJson(null,serializationMode) : null, "secondaryEndpoints" ,container.Add ); + } + AddIf( null != this._azureFilesIdentityBasedAuthentication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._azureFilesIdentityBasedAuthentication.ToJson(null,serializationMode) : null, "azureFilesIdentityBasedAuthentication" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._networkRuleSet ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._networkRuleSet.ToJson(null,serializationMode) : null, "networkAcls" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._geoReplicationStat ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._geoReplicationStat.ToJson(null,serializationMode) : null, "geoReplicationStats" ,container.Add ); + } + AddIf( null != this._routingPreference ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._routingPreference.ToJson(null,serializationMode) : null, "routingPreference" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._blobRestoreStatus ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._blobRestoreStatus.ToJson(null,serializationMode) : null, "blobRestoreStatus" ,container.Add ); + } + AddIf( null != this._immutableStorageWithVersioning ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._immutableStorageWithVersioning.ToJson(null,serializationMode) : null, "immutableStorageWithVersioning" ,container.Add ); + AddIf( null != this._storageAccountSkuConversionStatus ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._storageAccountSkuConversionStatus.ToJson(null,serializationMode) : null, "storageAccountSkuConversionStatus" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._provisioningState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._provisioningState.ToString()) : null, "provisioningState" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._primaryLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._primaryLocation.ToString()) : null, "primaryLocation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusOfPrimary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._statusOfPrimary.ToString()) : null, "statusOfPrimary" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._lastGeoFailoverTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._lastGeoFailoverTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "lastGeoFailoverTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._secondaryLocation)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._secondaryLocation.ToString()) : null, "secondaryLocation" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._statusOfSecondary)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._statusOfSecondary.ToString()) : null, "statusOfSecondary" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._creationTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._creationTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "creationTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._accessTier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accessTier.ToString()) : null, "accessTier" ,container.Add ); + } + AddIf( null != this._enableHttpsTrafficOnly ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableHttpsTrafficOnly) : null, "supportsHttpsTrafficOnly" ,container.Add ); + AddIf( null != this._isSftpEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isSftpEnabled) : null, "isSftpEnabled" ,container.Add ); + AddIf( null != this._isLocalUserEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isLocalUserEnabled) : null, "isLocalUserEnabled" ,container.Add ); + AddIf( null != this._isHnsEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isHnsEnabled) : null, "isHnsEnabled" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._failoverInProgress ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._failoverInProgress) : null, "failoverInProgress" ,container.Add ); + } + AddIf( null != (((object)this._largeFileSharesState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._largeFileSharesState.ToString()) : null, "largeFileSharesState" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._privateEndpointConnection) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._privateEndpointConnection ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("privateEndpointConnections",__w); + } + } + AddIf( null != this._allowBlobPublicAccess ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowBlobPublicAccess) : null, "allowBlobPublicAccess" ,container.Add ); + AddIf( null != (((object)this._minimumTlsVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._minimumTlsVersion.ToString()) : null, "minimumTlsVersion" ,container.Add ); + AddIf( null != this._allowSharedKeyAccess ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowSharedKeyAccess) : null, "allowSharedKeyAccess" ,container.Add ); + AddIf( null != this._enableNfsV3 ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableNfsV3) : null, "isNfsV3Enabled" ,container.Add ); + AddIf( null != this._allowCrossTenantReplication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowCrossTenantReplication) : null, "allowCrossTenantReplication" ,container.Add ); + AddIf( null != this._defaultToOAuthAuthentication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._defaultToOAuthAuthentication) : null, "defaultToOAuthAuthentication" ,container.Add ); + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + AddIf( null != (((object)this._allowedCopyScope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._allowedCopyScope.ToString()) : null, "allowedCopyScope" ,container.Add ); + AddIf( null != (((object)this._dnsEndpointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._dnsEndpointType.ToString()) : null, "dnsEndpointType" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._encryption ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._encryption.ToJson(null,serializationMode) : null, "encryption" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.PowerShell.cs new file mode 100644 index 000000000000..4f4e77d502f9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.PowerShell.cs @@ -0,0 +1,557 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The parameters used to create the storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesCreateParametersTypeConverter))] + public partial class StorageAccountPropertiesCreateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountPropertiesCreateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountPropertiesCreateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountPropertiesCreateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountPropertiesCreateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsHnsEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled = (bool?) content.GetValueForProperty("IsHnsEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).IsHnsEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("EnableNfsV3")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3 = (bool?) content.GetValueForProperty("EnableNfsV3",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).EnableNfsV3, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters used to create the storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesCreateParametersTypeConverter))] + public partial interface IStorageAccountPropertiesCreateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.TypeConverter.cs new file mode 100644 index 000000000000..083b04e3cd73 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountPropertiesCreateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountPropertiesCreateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountPropertiesCreateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountPropertiesCreateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.cs new file mode 100644 index 000000000000..a41bfe4fe10f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.cs @@ -0,0 +1,990 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used to create the storage account. + public partial class StorageAccountPropertiesCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? _accessTier; + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get => this._accessTier; set => this._accessTier = value; } + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); } + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyAzureStorageSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid = value ?? null; } + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid = value ?? null; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName = value ?? null; } + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid = value ?? null; } + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyForestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName = value ?? null; } + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyNetBiosDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName = value ?? null; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertySamAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// Backing field for property. + private bool? _allowBlobPublicAccess; + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowBlobPublicAccess { get => this._allowBlobPublicAccess; set => this._allowBlobPublicAccess = value; } + + /// Backing field for property. + private bool? _allowCrossTenantReplication; + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowCrossTenantReplication { get => this._allowCrossTenantReplication; set => this._allowCrossTenantReplication = value; } + + /// Backing field for property. + private bool? _allowSharedKeyAccess; + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowSharedKeyAccess { get => this._allowSharedKeyAccess; set => this._allowSharedKeyAccess = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? _allowedCopyScope; + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get => this._allowedCopyScope; set => this._allowedCopyScope = value; } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication _azureFilesIdentityBasedAuthentication; + + /// Provides the identity based authentication settings for Azure Files. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication()); set => this._azureFilesIdentityBasedAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain _customDomain; + + /// + /// User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage + /// account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain()); set => this._customDomain = value; } + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string CustomDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).Name = value ?? null; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? CustomDomainUseSubDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).UseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).UseSubDomainName = value ?? default(bool); } + + /// Backing field for property. + private bool? _defaultToOAuthAuthentication; + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? DefaultToOAuthAuthentication { get => this._defaultToOAuthAuthentication; set => this._defaultToOAuthAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? _dnsEndpointType; + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get => this._dnsEndpointType; set => this._dnsEndpointType = value; } + + /// Backing field for property. + private bool? _enableHttpsTrafficOnly; + + /// + /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableHttpsTrafficOnly { get => this._enableHttpsTrafficOnly; set => this._enableHttpsTrafficOnly = value; } + + /// Backing field for property. + private bool? _enableNfsV3; + + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableNfsV3 { get => this._enableNfsV3; set => this._enableNfsV3 = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption _encryption; + + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption()); set => this._encryption = value; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutabilityPolicyAllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount _immutableStorageWithVersioning; + + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the new containers in the account by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount()); set => this._immutableStorageWithVersioning = value; } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled = value ?? default(bool); } + + /// Backing field for property. + private bool? _isHnsEnabled; + + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsHnsEnabled { get => this._isHnsEnabled; set => this._isHnsEnabled = value; } + + /// Backing field for property. + private bool? _isLocalUserEnabled; + + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsLocalUserEnabled { get => this._isLocalUserEnabled; set => this._isLocalUserEnabled = value; } + + /// Backing field for property. + private bool? _isSftpEnabled; + + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsSftpEnabled { get => this._isSftpEnabled; set => this._isSftpEnabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy _keyPolicy; + + /// KeyPolicy assigned to the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy()); set => this._keyPolicy = value; } + + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? KeyPolicyKeyExpirationPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? _largeFileSharesState; + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get => this._largeFileSharesState; set => this._largeFileSharesState = value; } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication()); set { {_azureFilesIdentityBasedAuthentication = value;} } } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain()); set { {_customDomain = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy()); set { {_keyPolicy = value;} } } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet()); set { {_networkRuleSet = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference()); set { {_routingPreference = value;} } } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy()); set { {_sasPolicy = value;} } } + + /// Internal Acessors for SasPolicyExpirationAction + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParametersInternal.SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? _minimumTlsVersion; + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get => this._minimumTlsVersion; set => this._minimumTlsVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet _networkRuleSet; + + /// Network rule set + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet()); set => this._networkRuleSet = value; } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).Bypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).Bypass = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); } + + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); } + + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).IPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).IPRule = value ?? null /* arrayOf */; } + + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule = value ?? null /* arrayOf */; } + + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference _routingPreference; + + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference()); set => this._routingPreference = value; } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint = value ?? default(bool); } + + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy _sasPolicy; + + /// SasPolicy assigned to the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy()); set => this._sasPolicy = value; } + + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction; } + + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicySasExpirationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod = value ?? null; } + + /// + /// Creates an new instance. + /// + public StorageAccountPropertiesCreateParameters() + { + + } + } + /// The parameters used to create the storage account. + public partial interface IStorageAccountPropertiesCreateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(bool) })] + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(bool) })] + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// + /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NFS 3.0 protocol support enabled if set to true.", + SerializedName = @"isNfsV3Enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption settings to be used for server-side encryption for the storage account.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account HierarchicalNamespace enabled if sets to true.", + SerializedName = @"isHnsEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSftpEnabled { get; set; } + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SAS expiration action. Can only be Log.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(string) })] + string SasPolicyExpirationAction { get; } + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + string SasPolicySasExpirationPeriod { get; set; } + + } + /// The parameters used to create the storage account. + internal partial interface IStorageAccountPropertiesCreateParametersInternal + + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Provides the identity based authentication settings for Azure Files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; } + /// + /// User domain assigned to the storage account. Name is the CNAME source. Only one custom domain is supported per storage + /// account at this time. To clear the existing custom domain, use an empty string for the custom domain name property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// + /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + /// + bool? EnableHttpsTrafficOnly { get; set; } + /// NFS 3.0 protocol support enabled if set to true. + bool? EnableNfsV3 { get; set; } + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the new containers in the account by default. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutableStorageWithVersioningImmutabilityPolicy { get; set; } + /// Account HierarchicalNamespace enabled if sets to true. + bool? IsHnsEnabled { get; set; } + /// Enables local users feature, if set to true + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + bool? IsSftpEnabled { get; set; } + /// KeyPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get; set; } + /// The key expiration period in days. + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// Network rule set + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// SasPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get; set; } + /// The SAS expiration action. Can only be Log. + string SasPolicyExpirationAction { get; set; } + /// The SAS expiration period, DD.HH:MM:SS. + string SasPolicySasExpirationPeriod { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.json.cs new file mode 100644 index 000000000000..63cecf8b1e3c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesCreateParameters.json.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used to create the storage account. + public partial class StorageAccountPropertiesCreateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesCreateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountPropertiesCreateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountPropertiesCreateParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sasPolicy = If( json?.PropertyT("sasPolicy"), out var __jsonSasPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy.FromJson(__jsonSasPolicy) : SasPolicy;} + {_keyPolicy = If( json?.PropertyT("keyPolicy"), out var __jsonKeyPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy.FromJson(__jsonKeyPolicy) : KeyPolicy;} + {_customDomain = If( json?.PropertyT("customDomain"), out var __jsonCustomDomain) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain.FromJson(__jsonCustomDomain) : CustomDomain;} + {_networkRuleSet = If( json?.PropertyT("networkAcls"), out var __jsonNetworkAcls) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet.FromJson(__jsonNetworkAcls) : NetworkRuleSet;} + {_azureFilesIdentityBasedAuthentication = If( json?.PropertyT("azureFilesIdentityBasedAuthentication"), out var __jsonAzureFilesIdentityBasedAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication.FromJson(__jsonAzureFilesIdentityBasedAuthentication) : AzureFilesIdentityBasedAuthentication;} + {_routingPreference = If( json?.PropertyT("routingPreference"), out var __jsonRoutingPreference) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference.FromJson(__jsonRoutingPreference) : RoutingPreference;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount.FromJson(__jsonImmutableStorageWithVersioning) : ImmutableStorageWithVersioning;} + {_allowedCopyScope = If( json?.PropertyT("allowedCopyScope"), out var __jsonAllowedCopyScope) ? (string)__jsonAllowedCopyScope : (string)AllowedCopyScope;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_accessTier = If( json?.PropertyT("accessTier"), out var __jsonAccessTier) ? (string)__jsonAccessTier : (string)AccessTier;} + {_enableHttpsTrafficOnly = If( json?.PropertyT("supportsHttpsTrafficOnly"), out var __jsonSupportsHttpsTrafficOnly) ? (bool?)__jsonSupportsHttpsTrafficOnly : EnableHttpsTrafficOnly;} + {_isSftpEnabled = If( json?.PropertyT("isSftpEnabled"), out var __jsonIsSftpEnabled) ? (bool?)__jsonIsSftpEnabled : IsSftpEnabled;} + {_isLocalUserEnabled = If( json?.PropertyT("isLocalUserEnabled"), out var __jsonIsLocalUserEnabled) ? (bool?)__jsonIsLocalUserEnabled : IsLocalUserEnabled;} + {_isHnsEnabled = If( json?.PropertyT("isHnsEnabled"), out var __jsonIsHnsEnabled) ? (bool?)__jsonIsHnsEnabled : IsHnsEnabled;} + {_largeFileSharesState = If( json?.PropertyT("largeFileSharesState"), out var __jsonLargeFileSharesState) ? (string)__jsonLargeFileSharesState : (string)LargeFileSharesState;} + {_allowBlobPublicAccess = If( json?.PropertyT("allowBlobPublicAccess"), out var __jsonAllowBlobPublicAccess) ? (bool?)__jsonAllowBlobPublicAccess : AllowBlobPublicAccess;} + {_minimumTlsVersion = If( json?.PropertyT("minimumTlsVersion"), out var __jsonMinimumTlsVersion) ? (string)__jsonMinimumTlsVersion : (string)MinimumTlsVersion;} + {_allowSharedKeyAccess = If( json?.PropertyT("allowSharedKeyAccess"), out var __jsonAllowSharedKeyAccess) ? (bool?)__jsonAllowSharedKeyAccess : AllowSharedKeyAccess;} + {_enableNfsV3 = If( json?.PropertyT("isNfsV3Enabled"), out var __jsonIsNfsV3Enabled) ? (bool?)__jsonIsNfsV3Enabled : EnableNfsV3;} + {_allowCrossTenantReplication = If( json?.PropertyT("allowCrossTenantReplication"), out var __jsonAllowCrossTenantReplication) ? (bool?)__jsonAllowCrossTenantReplication : AllowCrossTenantReplication;} + {_defaultToOAuthAuthentication = If( json?.PropertyT("defaultToOAuthAuthentication"), out var __jsonDefaultToOAuthAuthentication) ? (bool?)__jsonDefaultToOAuthAuthentication : DefaultToOAuthAuthentication;} + {_dnsEndpointType = If( json?.PropertyT("dnsEndpointType"), out var __jsonDnsEndpointType) ? (string)__jsonDnsEndpointType : (string)DnsEndpointType;} + {_encryption = If( json?.PropertyT("encryption"), out var __jsonEncryption) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption.FromJson(__jsonEncryption) : Encryption;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sasPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sasPolicy.ToJson(null,serializationMode) : null, "sasPolicy" ,container.Add ); + AddIf( null != this._keyPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._keyPolicy.ToJson(null,serializationMode) : null, "keyPolicy" ,container.Add ); + AddIf( null != this._customDomain ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._customDomain.ToJson(null,serializationMode) : null, "customDomain" ,container.Add ); + AddIf( null != this._networkRuleSet ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._networkRuleSet.ToJson(null,serializationMode) : null, "networkAcls" ,container.Add ); + AddIf( null != this._azureFilesIdentityBasedAuthentication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._azureFilesIdentityBasedAuthentication.ToJson(null,serializationMode) : null, "azureFilesIdentityBasedAuthentication" ,container.Add ); + AddIf( null != this._routingPreference ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._routingPreference.ToJson(null,serializationMode) : null, "routingPreference" ,container.Add ); + AddIf( null != this._immutableStorageWithVersioning ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._immutableStorageWithVersioning.ToJson(null,serializationMode) : null, "immutableStorageWithVersioning" ,container.Add ); + AddIf( null != (((object)this._allowedCopyScope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._allowedCopyScope.ToString()) : null, "allowedCopyScope" ,container.Add ); + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + AddIf( null != (((object)this._accessTier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accessTier.ToString()) : null, "accessTier" ,container.Add ); + AddIf( null != this._enableHttpsTrafficOnly ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableHttpsTrafficOnly) : null, "supportsHttpsTrafficOnly" ,container.Add ); + AddIf( null != this._isSftpEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isSftpEnabled) : null, "isSftpEnabled" ,container.Add ); + AddIf( null != this._isLocalUserEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isLocalUserEnabled) : null, "isLocalUserEnabled" ,container.Add ); + AddIf( null != this._isHnsEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isHnsEnabled) : null, "isHnsEnabled" ,container.Add ); + AddIf( null != (((object)this._largeFileSharesState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._largeFileSharesState.ToString()) : null, "largeFileSharesState" ,container.Add ); + AddIf( null != this._allowBlobPublicAccess ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowBlobPublicAccess) : null, "allowBlobPublicAccess" ,container.Add ); + AddIf( null != (((object)this._minimumTlsVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._minimumTlsVersion.ToString()) : null, "minimumTlsVersion" ,container.Add ); + AddIf( null != this._allowSharedKeyAccess ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowSharedKeyAccess) : null, "allowSharedKeyAccess" ,container.Add ); + AddIf( null != this._enableNfsV3 ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableNfsV3) : null, "isNfsV3Enabled" ,container.Add ); + AddIf( null != this._allowCrossTenantReplication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowCrossTenantReplication) : null, "allowCrossTenantReplication" ,container.Add ); + AddIf( null != this._defaultToOAuthAuthentication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._defaultToOAuthAuthentication) : null, "defaultToOAuthAuthentication" ,container.Add ); + AddIf( null != (((object)this._dnsEndpointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._dnsEndpointType.ToString()) : null, "dnsEndpointType" ,container.Add ); + AddIf( null != this._encryption ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._encryption.ToJson(null,serializationMode) : null, "encryption" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..7ff12fd774dd --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.PowerShell.cs @@ -0,0 +1,541 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The parameters used when updating a storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesUpdateParametersTypeConverter))] + public partial class StorageAccountPropertiesUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountPropertiesUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountPropertiesUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountPropertiesUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountPropertiesUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters used when updating a storage account. + [System.ComponentModel.TypeConverter(typeof(StorageAccountPropertiesUpdateParametersTypeConverter))] + public partial interface IStorageAccountPropertiesUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..be7102dd78b4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.TypeConverter.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountPropertiesUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountPropertiesUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountPropertiesUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountPropertiesUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.cs new file mode 100644 index 000000000000..cbddad8b1cee --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.cs @@ -0,0 +1,952 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used when updating a storage account. + public partial class StorageAccountPropertiesUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? _accessTier; + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get => this._accessTier; set => this._accessTier = value; } + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAccountType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); } + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyAzureStorageSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyAzureStorageSid = value ?? null; } + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainGuid = value ?? null; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainName = value ?? null; } + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyDomainSid = value ?? null; } + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyForestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyForestName = value ?? null; } + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyNetBiosDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertyNetBiosDomainName = value ?? null; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertySamAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// Backing field for property. + private bool? _allowBlobPublicAccess; + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowBlobPublicAccess { get => this._allowBlobPublicAccess; set => this._allowBlobPublicAccess = value; } + + /// Backing field for property. + private bool? _allowCrossTenantReplication; + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowCrossTenantReplication { get => this._allowCrossTenantReplication; set => this._allowCrossTenantReplication = value; } + + /// Backing field for property. + private bool? _allowSharedKeyAccess; + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowSharedKeyAccess { get => this._allowSharedKeyAccess; set => this._allowSharedKeyAccess = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? _allowedCopyScope; + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get => this._allowedCopyScope; set => this._allowedCopyScope = value; } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DefaultSharePermission = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).DirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Backing field for property. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication _azureFilesIdentityBasedAuthentication; + + /// Provides the identity based authentication settings for Azure Files. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication()); set => this._azureFilesIdentityBasedAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain _customDomain; + + /// + /// Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported + /// per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name + /// property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain()); set => this._customDomain = value; } + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string CustomDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).Name = value ?? null; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? CustomDomainUseSubDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).UseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomainInternal)CustomDomain).UseSubDomainName = value ?? default(bool); } + + /// Backing field for property. + private bool? _defaultToOAuthAuthentication; + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? DefaultToOAuthAuthentication { get => this._defaultToOAuthAuthentication; set => this._defaultToOAuthAuthentication = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? _dnsEndpointType; + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get => this._dnsEndpointType; set => this._dnsEndpointType = value; } + + /// Backing field for property. + private bool? _enableHttpsTrafficOnly; + + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? EnableHttpsTrafficOnly { get => this._enableHttpsTrafficOnly; set => this._enableHttpsTrafficOnly = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption _encryption; + + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => (this._encryption = this._encryption ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption()); set => this._encryption = value; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutabilityPolicyAllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyAllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount _immutableStorageWithVersioning; + + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the containers in the account by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount()); set => this._immutableStorageWithVersioning = value; } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).Enabled = value ?? default(bool); } + + /// Backing field for property. + private bool? _isLocalUserEnabled; + + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsLocalUserEnabled { get => this._isLocalUserEnabled; set => this._isLocalUserEnabled = value; } + + /// Backing field for property. + private bool? _isSftpEnabled; + + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? IsSftpEnabled { get => this._isSftpEnabled; set => this._isSftpEnabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy _keyPolicy; + + /// KeyPolicy assigned to the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy()); set => this._keyPolicy = value; } + + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? KeyPolicyKeyExpirationPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicyInternal)KeyPolicy).KeyExpirationPeriodInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? _largeFileSharesState; + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get => this._largeFileSharesState; set => this._largeFileSharesState = value; } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthenticationInternal)AzureFilesIdentityBasedAuthentication).ActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.AzureFilesIdentityBasedAuthentication { get => (this._azureFilesIdentityBasedAuthentication = this._azureFilesIdentityBasedAuthentication ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication()); set { {_azureFilesIdentityBasedAuthentication = value;} } } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.CustomDomain { get => (this._customDomain = this._customDomain ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain()); set { {_customDomain = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.ImmutableStorageWithVersioning { get => (this._immutableStorageWithVersioning = this._immutableStorageWithVersioning ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount()); set { {_immutableStorageWithVersioning = value;} } } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccountInternal)ImmutableStorageWithVersioning).ImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.KeyPolicy { get => (this._keyPolicy = this._keyPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy()); set { {_keyPolicy = value;} } } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet()); set { {_networkRuleSet = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference()); set { {_routingPreference = value;} } } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy()); set { {_sasPolicy = value;} } } + + /// Internal Acessors for SasPolicyExpirationAction + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal.SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? _minimumTlsVersion; + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get => this._minimumTlsVersion; set => this._minimumTlsVersion = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet _networkRuleSet; + + /// Network rule set + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get => (this._networkRuleSet = this._networkRuleSet ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet()); set => this._networkRuleSet = value; } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).Bypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).Bypass = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); } + + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).DefaultAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); } + + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).IPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).IPRule = value ?? null /* arrayOf */; } + + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).ResourceAccessRule = value ?? null /* arrayOf */; } + + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSetInternal)NetworkRuleSet).VirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? _publicNetworkAccess; + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get => this._publicNetworkAccess; set => this._publicNetworkAccess = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference _routingPreference; + + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get => (this._routingPreference = this._routingPreference ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference()); set => this._routingPreference = value; } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishInternetEndpoint = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).PublishMicrosoftEndpoint = value ?? default(bool); } + + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreferenceInternal)RoutingPreference).RoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy _sasPolicy; + + /// SasPolicy assigned to the storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get => (this._sasPolicy = this._sasPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy()); set => this._sasPolicy = value; } + + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).ExpirationAction; } + + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicySasExpirationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicyInternal)SasPolicy).SasExpirationPeriod = value ?? null; } + + /// + /// Creates an new instance. + /// + public StorageAccountPropertiesUpdateParameters() + { + + } + } + /// The parameters used when updating a storage account. + public partial interface IStorageAccountPropertiesUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(bool) })] + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(bool) })] + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableHttpsTrafficOnly { get; set; } + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSftpEnabled { get; set; } + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SAS expiration action. Can only be Log.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(string) })] + string SasPolicyExpirationAction { get; } + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + string SasPolicySasExpirationPeriod { get; set; } + + } + /// The parameters used when updating a storage account. + internal partial interface IStorageAccountPropertiesUpdateParametersInternal + + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Provides the identity based authentication settings for Azure Files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; } + /// + /// Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported + /// per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name + /// property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + bool? EnableHttpsTrafficOnly { get; set; } + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the containers in the account by default. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutableStorageWithVersioningImmutabilityPolicy { get; set; } + /// Enables local users feature, if set to true + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + bool? IsSftpEnabled { get; set; } + /// KeyPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get; set; } + /// The key expiration period in days. + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// Network rule set + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// SasPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get; set; } + /// The SAS expiration action. Can only be Log. + string SasPolicyExpirationAction { get; set; } + /// The SAS expiration period, DD.HH:MM:SS. + string SasPolicySasExpirationPeriod { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.json.cs new file mode 100644 index 000000000000..286d73d23d69 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountPropertiesUpdateParameters.json.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used when updating a storage account. + public partial class StorageAccountPropertiesUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountPropertiesUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountPropertiesUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_customDomain = If( json?.PropertyT("customDomain"), out var __jsonCustomDomain) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomain.FromJson(__jsonCustomDomain) : CustomDomain;} + {_sasPolicy = If( json?.PropertyT("sasPolicy"), out var __jsonSasPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicy.FromJson(__jsonSasPolicy) : SasPolicy;} + {_keyPolicy = If( json?.PropertyT("keyPolicy"), out var __jsonKeyPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicy.FromJson(__jsonKeyPolicy) : KeyPolicy;} + {_azureFilesIdentityBasedAuthentication = If( json?.PropertyT("azureFilesIdentityBasedAuthentication"), out var __jsonAzureFilesIdentityBasedAuthentication) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthentication.FromJson(__jsonAzureFilesIdentityBasedAuthentication) : AzureFilesIdentityBasedAuthentication;} + {_networkRuleSet = If( json?.PropertyT("networkAcls"), out var __jsonNetworkAcls) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSet.FromJson(__jsonNetworkAcls) : NetworkRuleSet;} + {_routingPreference = If( json?.PropertyT("routingPreference"), out var __jsonRoutingPreference) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreference.FromJson(__jsonRoutingPreference) : RoutingPreference;} + {_immutableStorageWithVersioning = If( json?.PropertyT("immutableStorageWithVersioning"), out var __jsonImmutableStorageWithVersioning) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccount.FromJson(__jsonImmutableStorageWithVersioning) : ImmutableStorageWithVersioning;} + {_accessTier = If( json?.PropertyT("accessTier"), out var __jsonAccessTier) ? (string)__jsonAccessTier : (string)AccessTier;} + {_enableHttpsTrafficOnly = If( json?.PropertyT("supportsHttpsTrafficOnly"), out var __jsonSupportsHttpsTrafficOnly) ? (bool?)__jsonSupportsHttpsTrafficOnly : EnableHttpsTrafficOnly;} + {_isSftpEnabled = If( json?.PropertyT("isSftpEnabled"), out var __jsonIsSftpEnabled) ? (bool?)__jsonIsSftpEnabled : IsSftpEnabled;} + {_isLocalUserEnabled = If( json?.PropertyT("isLocalUserEnabled"), out var __jsonIsLocalUserEnabled) ? (bool?)__jsonIsLocalUserEnabled : IsLocalUserEnabled;} + {_largeFileSharesState = If( json?.PropertyT("largeFileSharesState"), out var __jsonLargeFileSharesState) ? (string)__jsonLargeFileSharesState : (string)LargeFileSharesState;} + {_allowBlobPublicAccess = If( json?.PropertyT("allowBlobPublicAccess"), out var __jsonAllowBlobPublicAccess) ? (bool?)__jsonAllowBlobPublicAccess : AllowBlobPublicAccess;} + {_minimumTlsVersion = If( json?.PropertyT("minimumTlsVersion"), out var __jsonMinimumTlsVersion) ? (string)__jsonMinimumTlsVersion : (string)MinimumTlsVersion;} + {_allowSharedKeyAccess = If( json?.PropertyT("allowSharedKeyAccess"), out var __jsonAllowSharedKeyAccess) ? (bool?)__jsonAllowSharedKeyAccess : AllowSharedKeyAccess;} + {_allowCrossTenantReplication = If( json?.PropertyT("allowCrossTenantReplication"), out var __jsonAllowCrossTenantReplication) ? (bool?)__jsonAllowCrossTenantReplication : AllowCrossTenantReplication;} + {_defaultToOAuthAuthentication = If( json?.PropertyT("defaultToOAuthAuthentication"), out var __jsonDefaultToOAuthAuthentication) ? (bool?)__jsonDefaultToOAuthAuthentication : DefaultToOAuthAuthentication;} + {_publicNetworkAccess = If( json?.PropertyT("publicNetworkAccess"), out var __jsonPublicNetworkAccess) ? (string)__jsonPublicNetworkAccess : (string)PublicNetworkAccess;} + {_allowedCopyScope = If( json?.PropertyT("allowedCopyScope"), out var __jsonAllowedCopyScope) ? (string)__jsonAllowedCopyScope : (string)AllowedCopyScope;} + {_dnsEndpointType = If( json?.PropertyT("dnsEndpointType"), out var __jsonDnsEndpointType) ? (string)__jsonDnsEndpointType : (string)DnsEndpointType;} + {_encryption = If( json?.PropertyT("encryption"), out var __jsonEncryption) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Encryption.FromJson(__jsonEncryption) : Encryption;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._customDomain ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._customDomain.ToJson(null,serializationMode) : null, "customDomain" ,container.Add ); + AddIf( null != this._sasPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sasPolicy.ToJson(null,serializationMode) : null, "sasPolicy" ,container.Add ); + AddIf( null != this._keyPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._keyPolicy.ToJson(null,serializationMode) : null, "keyPolicy" ,container.Add ); + AddIf( null != this._azureFilesIdentityBasedAuthentication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._azureFilesIdentityBasedAuthentication.ToJson(null,serializationMode) : null, "azureFilesIdentityBasedAuthentication" ,container.Add ); + AddIf( null != this._networkRuleSet ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._networkRuleSet.ToJson(null,serializationMode) : null, "networkAcls" ,container.Add ); + AddIf( null != this._routingPreference ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._routingPreference.ToJson(null,serializationMode) : null, "routingPreference" ,container.Add ); + AddIf( null != this._immutableStorageWithVersioning ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._immutableStorageWithVersioning.ToJson(null,serializationMode) : null, "immutableStorageWithVersioning" ,container.Add ); + AddIf( null != (((object)this._accessTier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accessTier.ToString()) : null, "accessTier" ,container.Add ); + AddIf( null != this._enableHttpsTrafficOnly ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._enableHttpsTrafficOnly) : null, "supportsHttpsTrafficOnly" ,container.Add ); + AddIf( null != this._isSftpEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isSftpEnabled) : null, "isSftpEnabled" ,container.Add ); + AddIf( null != this._isLocalUserEnabled ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._isLocalUserEnabled) : null, "isLocalUserEnabled" ,container.Add ); + AddIf( null != (((object)this._largeFileSharesState)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._largeFileSharesState.ToString()) : null, "largeFileSharesState" ,container.Add ); + AddIf( null != this._allowBlobPublicAccess ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowBlobPublicAccess) : null, "allowBlobPublicAccess" ,container.Add ); + AddIf( null != (((object)this._minimumTlsVersion)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._minimumTlsVersion.ToString()) : null, "minimumTlsVersion" ,container.Add ); + AddIf( null != this._allowSharedKeyAccess ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowSharedKeyAccess) : null, "allowSharedKeyAccess" ,container.Add ); + AddIf( null != this._allowCrossTenantReplication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowCrossTenantReplication) : null, "allowCrossTenantReplication" ,container.Add ); + AddIf( null != this._defaultToOAuthAuthentication ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._defaultToOAuthAuthentication) : null, "defaultToOAuthAuthentication" ,container.Add ); + AddIf( null != (((object)this._publicNetworkAccess)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._publicNetworkAccess.ToString()) : null, "publicNetworkAccess" ,container.Add ); + AddIf( null != (((object)this._allowedCopyScope)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._allowedCopyScope.ToString()) : null, "allowedCopyScope" ,container.Add ); + AddIf( null != (((object)this._dnsEndpointType)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._dnsEndpointType.ToString()) : null, "dnsEndpointType" ,container.Add ); + AddIf( null != this._encryption ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._encryption.ToJson(null,serializationMode) : null, "encryption" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.PowerShell.cs new file mode 100644 index 000000000000..7c23ec195272 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.PowerShell.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The parameters used to regenerate the storage account key. + [System.ComponentModel.TypeConverter(typeof(StorageAccountRegenerateKeyParametersTypeConverter))] + public partial class StorageAccountRegenerateKeyParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountRegenerateKeyParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountRegenerateKeyParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json + /// string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountRegenerateKeyParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParametersInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParametersInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountRegenerateKeyParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("KeyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParametersInternal)this).KeyName = (string) content.GetValueForProperty("KeyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParametersInternal)this).KeyName, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters used to regenerate the storage account key. + [System.ComponentModel.TypeConverter(typeof(StorageAccountRegenerateKeyParametersTypeConverter))] + public partial interface IStorageAccountRegenerateKeyParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.TypeConverter.cs new file mode 100644 index 000000000000..7089e878d1d4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.TypeConverter.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountRegenerateKeyParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountRegenerateKeyParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountRegenerateKeyParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountRegenerateKeyParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.cs new file mode 100644 index 000000000000..9db29d78b7d6 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used to regenerate the storage account key. + public partial class StorageAccountRegenerateKeyParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParametersInternal + { + + /// Backing field for property. + private string _keyName; + + /// + /// The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string KeyName { get => this._keyName; set => this._keyName = value; } + + /// Creates an new instance. + public StorageAccountRegenerateKeyParameters() + { + + } + } + /// The parameters used to regenerate the storage account key. + public partial interface IStorageAccountRegenerateKeyParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + string KeyName { get; set; } + + } + /// The parameters used to regenerate the storage account key. + internal partial interface IStorageAccountRegenerateKeyParametersInternal + + { + /// + /// The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + /// + string KeyName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.json.cs new file mode 100644 index 000000000000..4a9e5d9c6f9c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountRegenerateKeyParameters.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The parameters used to regenerate the storage account key. + public partial class StorageAccountRegenerateKeyParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountRegenerateKeyParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountRegenerateKeyParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_keyName = If( json?.PropertyT("keyName"), out var __jsonKeyName) ? (string)__jsonKeyName : (string)KeyName;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._keyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._keyName.ToString()) : null, "keyName" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.PowerShell.cs new file mode 100644 index 000000000000..b914eba4fcda --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.PowerShell.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// This defines the sku conversion status object for asynchronous sku conversions. + [System.ComponentModel.TypeConverter(typeof(StorageAccountSkuConversionStatusTypeConverter))] + public partial class StorageAccountSkuConversionStatus + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountSkuConversionStatus(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountSkuConversionStatus(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountSkuConversionStatus(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("TargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("TargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).EndTime, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountSkuConversionStatus(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SkuConversionStatus")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus?) content.GetValueForProperty("SkuConversionStatus",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).SkuConversionStatus, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus.CreateFrom); + } + if (content.Contains("TargetSkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName?) content.GetValueForProperty("TargetSkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).TargetSkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).StartTime = (string) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).StartTime, global::System.Convert.ToString); + } + if (content.Contains("EndTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).EndTime = (string) content.GetValueForProperty("EndTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal)this).EndTime, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// This defines the sku conversion status object for asynchronous sku conversions. + [System.ComponentModel.TypeConverter(typeof(StorageAccountSkuConversionStatusTypeConverter))] + public partial interface IStorageAccountSkuConversionStatus + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.TypeConverter.cs new file mode 100644 index 000000000000..8dd1caed5679 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountSkuConversionStatusTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountSkuConversionStatus.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountSkuConversionStatus.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountSkuConversionStatus.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.cs new file mode 100644 index 000000000000..260d423a7a64 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// This defines the sku conversion status object for asynchronous sku conversions. + public partial class StorageAccountSkuConversionStatus : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal + { + + /// Backing field for property. + private string _endTime; + + /// This property represents the sku conversion end time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string EndTime { get => this._endTime; } + + /// Internal Acessors for EndTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal.EndTime { get => this._endTime; set { {_endTime = value;} } } + + /// Internal Acessors for SkuConversionStatus + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal.SkuConversionStatus { get => this._skuConversionStatus; set { {_skuConversionStatus = value;} } } + + /// Internal Acessors for StartTime + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatusInternal.StartTime { get => this._startTime; set { {_startTime = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? _skuConversionStatus; + + /// This property indicates the current sku conversion status. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? SkuConversionStatus { get => this._skuConversionStatus; } + + /// Backing field for property. + private string _startTime; + + /// This property represents the sku conversion start time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string StartTime { get => this._startTime; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? _targetSkuName; + + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? TargetSkuName { get => this._targetSkuName; set => this._targetSkuName = value; } + + /// Creates an new instance. + public StorageAccountSkuConversionStatus() + { + + } + } + /// This defines the sku conversion status object for asynchronous sku conversions. + public partial interface IStorageAccountSkuConversionStatus : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// This property represents the sku conversion end time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property represents the sku conversion end time.", + SerializedName = @"endTime", + PossibleTypes = new [] { typeof(string) })] + string EndTime { get; } + /// This property indicates the current sku conversion status. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property indicates the current sku conversion status.", + SerializedName = @"skuConversionStatus", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? SkuConversionStatus { get; } + /// This property represents the sku conversion start time. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"This property represents the sku conversion start time.", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(string) })] + string StartTime { get; } + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property represents the target sku name to which the account sku is being converted asynchronously.", + SerializedName = @"targetSkuName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? TargetSkuName { get; set; } + + } + /// This defines the sku conversion status object for asynchronous sku conversions. + internal partial interface IStorageAccountSkuConversionStatusInternal + + { + /// This property represents the sku conversion end time. + string EndTime { get; set; } + /// This property indicates the current sku conversion status. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus? SkuConversionStatus { get; set; } + /// This property represents the sku conversion start time. + string StartTime { get; set; } + /// + /// This property represents the target sku name to which the account sku is being converted asynchronously. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? TargetSkuName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.json.cs new file mode 100644 index 000000000000..c9f5e1baaaac --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountSkuConversionStatus.json.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// This defines the sku conversion status object for asynchronous sku conversions. + public partial class StorageAccountSkuConversionStatus + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountSkuConversionStatus FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountSkuConversionStatus(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountSkuConversionStatus(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_skuConversionStatus = If( json?.PropertyT("skuConversionStatus"), out var __jsonSkuConversionStatus) ? (string)__jsonSkuConversionStatus : (string)SkuConversionStatus;} + {_targetSkuName = If( json?.PropertyT("targetSkuName"), out var __jsonTargetSkuName) ? (string)__jsonTargetSkuName : (string)TargetSkuName;} + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? (string)__jsonStartTime : (string)StartTime;} + {_endTime = If( json?.PropertyT("endTime"), out var __jsonEndTime) ? (string)__jsonEndTime : (string)EndTime;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._skuConversionStatus)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._skuConversionStatus.ToString()) : null, "skuConversionStatus" ,container.Add ); + } + AddIf( null != (((object)this._targetSkuName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._targetSkuName.ToString()) : null, "targetSkuName" ,container.Add ); + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._startTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startTime.ToString()) : null, "startTime" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._endTime)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._endTime.ToString()) : null, "endTime" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.PowerShell.cs new file mode 100644 index 000000000000..9234628ee815 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.PowerShell.cs @@ -0,0 +1,628 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// The parameters that can be provided when updating the storage account properties. + /// + [System.ComponentModel.TypeConverter(typeof(StorageAccountUpdateParametersTypeConverter))] + public partial class StorageAccountUpdateParameters + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountUpdateParameters(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountUpdateParameters(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountUpdateParameters(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesUpdateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountUpdateParameters(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Sku")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Sku = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku) content.GetValueForProperty("Sku",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Sku, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuTypeConverter.ConvertFrom); + } + if (content.Contains("Identity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Identity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity) content.GetValueForProperty("Identity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Identity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityTypeConverter.ConvertFrom); + } + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesUpdateParametersTypeConverter.ConvertFrom); + } + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Tag = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Tag, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParametersTagsTypeConverter.ConvertFrom); + } + if (content.Contains("Kind")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Kind = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind?) content.GetValueForProperty("Kind",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Kind, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind.CreateFrom); + } + if (content.Contains("SkuName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) content.GetValueForProperty("SkuName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName.CreateFrom); + } + if (content.Contains("SkuTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier?) content.GetValueForProperty("SkuTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SkuTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier.CreateFrom); + } + if (content.Contains("IdentityPrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId = (string) content.GetValueForProperty("IdentityPrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityPrincipalId, global::System.Convert.ToString); + } + if (content.Contains("IdentityTenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId = (string) content.GetValueForProperty("IdentityTenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityTenantId, global::System.Convert.ToString); + } + if (content.Contains("IdentityType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) content.GetValueForProperty("IdentityType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType.CreateFrom); + } + if (content.Contains("CustomDomain")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomain = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain) content.GetValueForProperty("CustomDomain",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomain, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CustomDomainTypeConverter.ConvertFrom); + } + if (content.Contains("SasPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy) content.GetValueForProperty("SasPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SasPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("KeyPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy) content.GetValueForProperty("KeyPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.KeyPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("RoutingPreference")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreference = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference) content.GetValueForProperty("RoutingPreference",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreference, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.RoutingPreferenceTypeConverter.ConvertFrom); + } + if (content.Contains("AccessTier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AccessTier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier?) content.GetValueForProperty("AccessTier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AccessTier, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier.CreateFrom); + } + if (content.Contains("Encryption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Encryption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) content.GetValueForProperty("Encryption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).Encryption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionTypeConverter.ConvertFrom); + } + if (content.Contains("IdentityUserAssignedIdentity")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) content.GetValueForProperty("IdentityUserAssignedIdentity",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IdentityUserAssignedIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IdentityUserAssignedIdentitiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFilesIdentityBasedAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication) content.GetValueForProperty("AzureFilesIdentityBasedAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFilesIdentityBasedAuthentication, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AzureFilesIdentityBasedAuthenticationTypeConverter.ConvertFrom); + } + if (content.Contains("NetworkRuleSet")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet) content.GetValueForProperty("NetworkRuleSet",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSet, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.NetworkRuleSetTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioning")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount) content.GetValueForProperty("ImmutableStorageWithVersioning",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioning, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutableStorageAccountTypeConverter.ConvertFrom); + } + if (content.Contains("EnableHttpsTrafficOnly")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly = (bool?) content.GetValueForProperty("EnableHttpsTrafficOnly",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).EnableHttpsTrafficOnly, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsSftpEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled = (bool?) content.GetValueForProperty("IsSftpEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsSftpEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("IsLocalUserEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled = (bool?) content.GetValueForProperty("IsLocalUserEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).IsLocalUserEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("LargeFileSharesState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState?) content.GetValueForProperty("LargeFileSharesState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).LargeFileSharesState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState.CreateFrom); + } + if (content.Contains("AllowBlobPublicAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess = (bool?) content.GetValueForProperty("AllowBlobPublicAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowBlobPublicAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("MinimumTlsVersion")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion?) content.GetValueForProperty("MinimumTlsVersion",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).MinimumTlsVersion, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion.CreateFrom); + } + if (content.Contains("AllowSharedKeyAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess = (bool?) content.GetValueForProperty("AllowSharedKeyAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowSharedKeyAccess, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowCrossTenantReplication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication = (bool?) content.GetValueForProperty("AllowCrossTenantReplication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowCrossTenantReplication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("DefaultToOAuthAuthentication")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication = (bool?) content.GetValueForProperty("DefaultToOAuthAuthentication",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DefaultToOAuthAuthentication, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("PublicNetworkAccess")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess?) content.GetValueForProperty("PublicNetworkAccess",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).PublicNetworkAccess, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess.CreateFrom); + } + if (content.Contains("AllowedCopyScope")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope?) content.GetValueForProperty("AllowedCopyScope",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AllowedCopyScope, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope.CreateFrom); + } + if (content.Contains("DnsEndpointType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType?) content.GetValueForProperty("DnsEndpointType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).DnsEndpointType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType.CreateFrom); + } + if (content.Contains("CustomDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainName = (string) content.GetValueForProperty("CustomDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainName, global::System.Convert.ToString); + } + if (content.Contains("SasPolicyExpirationAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction = (string) content.GetValueForProperty("SasPolicyExpirationAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicyExpirationAction, global::System.Convert.ToString); + } + if (content.Contains("NetworkRuleSetBypass")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass?) content.GetValueForProperty("NetworkRuleSetBypass",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetBypass, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass.CreateFrom); + } + if (content.Contains("NetworkRuleSetIPRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[]) content.GetValueForProperty("NetworkRuleSetIPRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetIPRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetDefaultAction")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) content.GetValueForProperty("NetworkRuleSetDefaultAction",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetDefaultAction, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction.CreateFrom); + } + if (content.Contains("RoutingPreferenceRoutingChoice")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice?) content.GetValueForProperty("RoutingPreferenceRoutingChoice",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferenceRoutingChoice, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice.CreateFrom); + } + if (content.Contains("CustomDomainUseSubDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName = (bool?) content.GetValueForProperty("CustomDomainUseSubDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).CustomDomainUseSubDomainName, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("SasPolicySasExpirationPeriod")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod = (string) content.GetValueForProperty("SasPolicySasExpirationPeriod",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).SasPolicySasExpirationPeriod, global::System.Convert.ToString); + } + if (content.Contains("KeyPolicyKeyExpirationPeriodInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay = (int) content.GetValueForProperty("KeyPolicyKeyExpirationPeriodInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).KeyPolicyKeyExpirationPeriodInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationActiveDirectoryProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ActiveDirectoryPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDirectoryServiceOption")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDirectoryServiceOption",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDirectoryServiceOption, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions.CreateFrom); + } + if (content.Contains("AzureFileIdentityBasedAuthenticationDefaultSharePermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission?) content.GetValueForProperty("AzureFileIdentityBasedAuthenticationDefaultSharePermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).AzureFileIdentityBasedAuthenticationDefaultSharePermission, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission.CreateFrom); + } + if (content.Contains("ActiveDirectoryPropertyDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyForestName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName = (string) content.GetValueForProperty("ActiveDirectoryPropertyForestName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyForestName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainGuid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainGuid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainGuid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyDomainSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyDomainSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyDomainSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAccountType")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType?) content.GetValueForProperty("ActiveDirectoryPropertyAccountType",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAccountType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType.CreateFrom); + } + if (content.Contains("NetworkRuleSetResourceAccessRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[]) content.GetValueForProperty("NetworkRuleSetResourceAccessRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetResourceAccessRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ResourceAccessRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("NetworkRuleSetVirtualNetworkRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[]) content.GetValueForProperty("NetworkRuleSetVirtualNetworkRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).NetworkRuleSetVirtualNetworkRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.VirtualNetworkRuleTypeConverter.ConvertFrom)); + } + if (content.Contains("RoutingPreferencePublishMicrosoftEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishMicrosoftEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishMicrosoftEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("RoutingPreferencePublishInternetEndpoint")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint = (bool?) content.GetValueForProperty("RoutingPreferencePublishInternetEndpoint",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).RoutingPreferencePublishInternetEndpoint, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ImmutableStorageWithVersioningImmutabilityPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties) content.GetValueForProperty("ImmutableStorageWithVersioningImmutabilityPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningImmutabilityPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountImmutabilityPolicyPropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("ImmutableStorageWithVersioningEnabled")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled = (bool?) content.GetValueForProperty("ImmutableStorageWithVersioningEnabled",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutableStorageWithVersioningEnabled, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("ActiveDirectoryPropertyNetBiosDomainName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName = (string) content.GetValueForProperty("ActiveDirectoryPropertyNetBiosDomainName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyNetBiosDomainName, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertyAzureStorageSid")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid = (string) content.GetValueForProperty("ActiveDirectoryPropertyAzureStorageSid",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertyAzureStorageSid, global::System.Convert.ToString); + } + if (content.Contains("ActiveDirectoryPropertySamAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName = (string) content.GetValueForProperty("ActiveDirectoryPropertySamAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ActiveDirectoryPropertySamAccountName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("ImmutabilityPolicyState")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState?) content.GetValueForProperty("ImmutabilityPolicyState",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyState, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState.CreateFrom); + } + if (content.Contains("ImmutabilityPolicyAllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite = (bool?) content.GetValueForProperty("ImmutabilityPolicyAllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal)this).ImmutabilityPolicyAllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The parameters that can be provided when updating the storage account properties. + [System.ComponentModel.TypeConverter(typeof(StorageAccountUpdateParametersTypeConverter))] + public partial interface IStorageAccountUpdateParameters + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.TypeConverter.cs new file mode 100644 index 000000000000..a4211b6e846a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.TypeConverter.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountUpdateParametersTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountUpdateParameters.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountUpdateParameters.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountUpdateParameters.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.cs new file mode 100644 index 000000000000..391803397f4c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.cs @@ -0,0 +1,1052 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The parameters that can be provided when updating the storage account properties. + /// + public partial class StorageAccountUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal + { + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AccessTier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AccessTier = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier)""); } + + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyAccountType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyAccountType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); } + + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyAzureStorageSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyAzureStorageSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyAzureStorageSid = value ?? null; } + + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainGuid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainGuid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainGuid = value ?? null; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainName = value ?? null; } + + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyDomainSid { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainSid; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyDomainSid = value ?? null; } + + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyForestName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyForestName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyForestName = value ?? null; } + + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertyNetBiosDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyNetBiosDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertyNetBiosDomainName = value ?? null; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string ActiveDirectoryPropertySamAccountName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertySamAccountName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ActiveDirectoryPropertySamAccountName = value ?? null; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowBlobPublicAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowBlobPublicAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowBlobPublicAccess = value ?? default(bool); } + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowCrossTenantReplication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowCrossTenantReplication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowCrossTenantReplication = value ?? default(bool); } + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? AllowSharedKeyAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowSharedKeyAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowSharedKeyAccess = value ?? default(bool); } + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowedCopyScope; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AllowedCopyScope = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope)""); } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDefaultSharePermission = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationDirectoryServiceOption = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); } + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string CustomDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomainName = value ?? null; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? CustomDomainUseSubDomainName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomainUseSubDomainName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomainUseSubDomainName = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? DefaultToOAuthAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).DefaultToOAuthAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).DefaultToOAuthAuthentication = value ?? default(bool); } + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).DnsEndpointType; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).DnsEndpointType = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); } + + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? EnableHttpsTrafficOnly { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).EnableHttpsTrafficOnly; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).EnableHttpsTrafficOnly = value ?? default(bool); } + + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).Encryption; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).Encryption = value ?? null /* model class */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity _identity; + + /// The identity of the resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity()); set => this._identity = value; } + + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId; } + + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId; } + + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).Type = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType)""); } + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).UserAssignedIdentity; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).UserAssignedIdentity = value ?? null /* model class */; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutabilityPolicyAllowProtectedAppendWrite { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyAllowProtectedAppendWrite = value ?? default(bool); } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value ?? default(int); } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutabilityPolicyState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? ImmutableStorageWithVersioningEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioningEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioningEnabled = value ?? default(bool); } + + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsLocalUserEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).IsLocalUserEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).IsLocalUserEnabled = value ?? default(bool); } + + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? IsSftpEnabled { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).IsSftpEnabled; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).IsSftpEnabled = value ?? default(bool); } + + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? KeyPolicyKeyExpirationPeriodInDay { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).KeyPolicyKeyExpirationPeriodInDay; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).KeyPolicyKeyExpirationPeriodInDay = value ?? default(int); } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? _kind; + + /// + /// Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get => this._kind; set => this._kind = value; } + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).LargeFileSharesState; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).LargeFileSharesState = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState)""); } + + /// + /// Internal Acessors for AzureFileIdentityBasedAuthenticationActiveDirectoryProperty + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFileIdentityBasedAuthenticationActiveDirectoryProperty = value; } + + /// Internal Acessors for AzureFilesIdentityBasedAuthentication + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.AzureFilesIdentityBasedAuthentication { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFilesIdentityBasedAuthentication; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).AzureFilesIdentityBasedAuthentication = value; } + + /// Internal Acessors for CustomDomain + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.CustomDomain { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomain; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).CustomDomain = value; } + + /// Internal Acessors for Identity + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.Identity { get => (this._identity = this._identity ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity()); set { {_identity = value;} } } + + /// Internal Acessors for IdentityPrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.IdentityPrincipalId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).PrincipalId = value; } + + /// Internal Acessors for IdentityTenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.IdentityTenantId { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityInternal)Identity).TenantId = value; } + + /// Internal Acessors for ImmutableStorageWithVersioning + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.ImmutableStorageWithVersioning { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioning; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioning = value; } + + /// Internal Acessors for ImmutableStorageWithVersioningImmutabilityPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.ImmutableStorageWithVersioningImmutabilityPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).ImmutableStorageWithVersioningImmutabilityPolicy = value; } + + /// Internal Acessors for KeyPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.KeyPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).KeyPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).KeyPolicy = value; } + + /// Internal Acessors for NetworkRuleSet + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.NetworkRuleSet { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSet; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSet = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesUpdateParameters()); set { {_property = value;} } } + + /// Internal Acessors for RoutingPreference + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.RoutingPreference { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreference; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreference = value; } + + /// Internal Acessors for SasPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.SasPolicy { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicy; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicy = value; } + + /// Internal Acessors for SasPolicyExpirationAction + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicyExpirationAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicyExpirationAction = value; } + + /// Internal Acessors for Sku + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); set { {_sku = value;} } } + + /// Internal Acessors for SkuTier + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersInternal.SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier = value; } + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).MinimumTlsVersion; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).MinimumTlsVersion = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion)""); } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetBypass; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetBypass = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); } + + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetDefaultAction; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetDefaultAction = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); } + + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetIPRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetIPRule = value ?? null /* arrayOf */; } + + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetResourceAccessRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetResourceAccessRule = value ?? null /* arrayOf */; } + + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).NetworkRuleSetVirtualNetworkRule = value ?? null /* arrayOf */; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters _property; + + /// The parameters used when updating a storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesUpdateParameters()); set => this._property = value; } + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).PublicNetworkAccess; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).PublicNetworkAccess = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess)""); } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishInternetEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferencePublishInternetEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferencePublishInternetEndpoint = value ?? default(bool); } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public bool? RoutingPreferencePublishMicrosoftEndpoint { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferencePublishMicrosoftEndpoint; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferencePublishMicrosoftEndpoint = value ?? default(bool); } + + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferenceRoutingChoice; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).RoutingPreferenceRoutingChoice = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); } + + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicyExpirationAction { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicyExpirationAction; } + + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string SasPolicySasExpirationPeriod { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicySasExpirationPeriod; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParametersInternal)Property).SasPolicySasExpirationPeriod = value ?? null; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku _sku; + + /// + /// Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can + /// accounts of those SKU names be updated to any other value. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get => (this._sku = this._sku ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku()); set => this._sku = value; } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Name = value ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); } + + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInternal)Sku).Tier; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags _tag; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags Tag { get => (this._tag = this._tag ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParametersTags()); set => this._tag = value; } + + /// Creates an new instance. + public StorageAccountUpdateParameters() + { + + } + } + /// The parameters that can be provided when updating the storage account properties. + public partial interface IStorageAccountUpdateParameters : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(bool) })] + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(bool) })] + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(bool) })] + bool? EnableHttpsTrafficOnly { get; set; } + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// The principal ID of resource identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal ID of resource identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string IdentityPrincipalId { get; } + /// The tenant ID of resource. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The tenant ID of resource.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string IdentityTenantId { get; } + /// The identity type. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(bool) })] + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// Enables local users feature, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(bool) })] + bool? IsSftpEnabled { get; set; } + /// The key expiration period in days. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(bool) })] + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// The SAS expiration action. Can only be Log. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SAS expiration action. Can only be Log.", + SerializedName = @"expirationAction", + PossibleTypes = new [] { typeof(string) })] + string SasPolicyExpirationAction { get; } + /// The SAS expiration period, DD.HH:MM:SS. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + string SasPolicySasExpirationPeriod { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The SKU tier. This is based on the SKU name.", + SerializedName = @"tier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; } + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags Tag { get; set; } + + } + /// The parameters that can be provided when updating the storage account properties. + internal partial interface IStorageAccountUpdateParametersInternal + + { + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier? AccessTier { get; set; } + /// Specifies the Active Directory account type for Azure Storage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType? ActiveDirectoryPropertyAccountType { get; set; } + /// Specifies the security identifier (SID) for Azure Storage. + string ActiveDirectoryPropertyAzureStorageSid { get; set; } + /// Specifies the domain GUID. + string ActiveDirectoryPropertyDomainGuid { get; set; } + /// Specifies the primary domain that the AD DNS server is authoritative for. + string ActiveDirectoryPropertyDomainName { get; set; } + /// Specifies the security identifier (SID). + string ActiveDirectoryPropertyDomainSid { get; set; } + /// Specifies the Active Directory forest to get. + string ActiveDirectoryPropertyForestName { get; set; } + /// Specifies the NetBIOS domain name. + string ActiveDirectoryPropertyNetBiosDomainName { get; set; } + /// Specifies the Active Directory SAMAccountName for Azure Storage. + string ActiveDirectoryPropertySamAccountName { get; set; } + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + bool? AllowBlobPublicAccess { get; set; } + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + bool? AllowCrossTenantReplication { get; set; } + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + bool? AllowSharedKeyAccess { get; set; } + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope? AllowedCopyScope { get; set; } + /// Required if directoryServiceOptions are AD, optional if they are AADKERB. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IActiveDirectoryProperties AzureFileIdentityBasedAuthenticationActiveDirectoryProperty { get; set; } + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission? AzureFileIdentityBasedAuthenticationDefaultSharePermission { get; set; } + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions? AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get; set; } + /// Provides the identity based authentication settings for Azure Files. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAzureFilesIdentityBasedAuthentication AzureFilesIdentityBasedAuthentication { get; set; } + /// + /// Custom domain assigned to the storage account by the user. Name is the CNAME source. Only one custom domain is supported + /// per storage account at this time. To clear the existing custom domain, use an empty string for the custom domain name + /// property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICustomDomain CustomDomain { get; set; } + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + string CustomDomainName { get; set; } + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + bool? CustomDomainUseSubDomainName { get; set; } + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + bool? DefaultToOAuthAuthentication { get; set; } + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType? DnsEndpointType { get; set; } + /// Allows https traffic only to storage service if sets to true. + bool? EnableHttpsTrafficOnly { get; set; } + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get; set; } + /// The identity of the resource. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentity Identity { get; set; } + /// The principal ID of resource identity. + string IdentityPrincipalId { get; set; } + /// The tenant ID of resource. + string IdentityTenantId { get; set; } + /// The identity type. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType? IdentityType { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get; set; } + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + bool? ImmutabilityPolicyAllowProtectedAppendWrite { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get; set; } + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState? ImmutabilityPolicyState { get; set; } + /// + /// The property is immutable and can only be set to true at the account creation time. When set to true, it enables object + /// level immutability for all the containers in the account by default. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutableStorageAccount ImmutableStorageWithVersioning { get; set; } + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + bool? ImmutableStorageWithVersioningEnabled { get; set; } + /// + /// Specifies the default account-level immutability policy which is inherited and applied to objects that do not possess + /// an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the + /// container-level immutability policy, which has a higher precedence than the account-level immutability policy. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountImmutabilityPolicyProperties ImmutableStorageWithVersioningImmutabilityPolicy { get; set; } + /// Enables local users feature, if set to true + bool? IsLocalUserEnabled { get; set; } + /// Enables Secure File Transfer Protocol, if set to true + bool? IsSftpEnabled { get; set; } + /// KeyPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IKeyPolicy KeyPolicy { get; set; } + /// The key expiration period in days. + int? KeyPolicyKeyExpirationPeriodInDay { get; set; } + /// + /// Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind? Kind { get; set; } + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState? LargeFileSharesState { get; set; } + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion? MinimumTlsVersion { get; set; } + /// Network rule set + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.INetworkRuleSet NetworkRuleSet { get; set; } + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass? NetworkRuleSetBypass { get; set; } + /// Specifies the default action of allow or deny when no other rules match. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction? NetworkRuleSetDefaultAction { get; set; } + /// Sets the IP ACL rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get; set; } + /// Sets the resource access rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get; set; } + /// Sets the virtual network rules + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get; set; } + /// The parameters used when updating a storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountPropertiesUpdateParameters Property { get; set; } + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess? PublicNetworkAccess { get; set; } + /// + /// Maintains information about the network routing choice opted by the user for data transfer + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IRoutingPreference RoutingPreference { get; set; } + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishInternetEndpoint { get; set; } + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + bool? RoutingPreferencePublishMicrosoftEndpoint { get; set; } + /// Routing Choice defines the kind of network routing opted by the user. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice? RoutingPreferenceRoutingChoice { get; set; } + /// SasPolicy assigned to the storage account. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISasPolicy SasPolicy { get; set; } + /// The SAS expiration action. Can only be Log. + string SasPolicyExpirationAction { get; set; } + /// The SAS expiration period, DD.HH:MM:SS. + string SasPolicySasExpirationPeriod { get; set; } + /// + /// Gets or sets the SKU name. Note that the SKU name cannot be updated to Standard_ZRS, Premium_LRS or Premium_ZRS, nor can + /// accounts of those SKU names be updated to any other value. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISku Sku { get; set; } + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName? SkuName { get; set; } + /// The SKU tier. This is based on the SKU name. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier? SkuTier { get; set; } + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags Tag { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.json.cs new file mode 100644 index 000000000000..606527e9d3eb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParameters.json.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// The parameters that can be provided when updating the storage account properties. + /// + public partial class StorageAccountUpdateParameters + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountUpdateParameters(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageAccountUpdateParameters(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_sku = If( json?.PropertyT("sku"), out var __jsonSku) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Sku.FromJson(__jsonSku) : Sku;} + {_identity = If( json?.PropertyT("identity"), out var __jsonIdentity) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Identity.FromJson(__jsonIdentity) : Identity;} + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountPropertiesUpdateParameters.FromJson(__jsonProperties) : Property;} + {_tag = If( json?.PropertyT("tags"), out var __jsonTags) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParametersTags.FromJson(__jsonTags) : Tag;} + {_kind = If( json?.PropertyT("kind"), out var __jsonKind) ? (string)__jsonKind : (string)Kind;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._sku ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._sku.ToJson(null,serializationMode) : null, "sku" ,container.Add ); + AddIf( null != this._identity ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._identity.ToJson(null,serializationMode) : null, "identity" ,container.Add ); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AddIf( null != this._tag ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tag.ToJson(null,serializationMode) : null, "tags" ,container.Add ); + AddIf( null != (((object)this._kind)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._kind.ToString()) : null, "kind" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.PowerShell.cs new file mode 100644 index 000000000000..5eb0441bb982 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + [System.ComponentModel.TypeConverter(typeof(StorageAccountUpdateParametersTagsTypeConverter))] + public partial class StorageAccountUpdateParametersTags + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageAccountUpdateParametersTags(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageAccountUpdateParametersTags(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageAccountUpdateParametersTags(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageAccountUpdateParametersTags(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + // this type is a dictionary; copy elements from source to here. + CopyFrom(content); + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + [System.ComponentModel.TypeConverter(typeof(StorageAccountUpdateParametersTagsTypeConverter))] + public partial interface IStorageAccountUpdateParametersTags + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.TypeConverter.cs new file mode 100644 index 000000000000..34ca9fde961c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageAccountUpdateParametersTagsTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageAccountUpdateParametersTags.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageAccountUpdateParametersTags.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageAccountUpdateParametersTags.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.cs new file mode 100644 index 000000000000..55cc4a67f196 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + public partial class StorageAccountUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTagsInternal + { + + /// Creates an new instance. + public StorageAccountUpdateParametersTags() + { + + } + } + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + public partial interface IStorageAccountUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + + } + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + internal partial interface IStorageAccountUpdateParametersTagsInternal + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.dictionary.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.dictionary.cs new file mode 100644 index 000000000000..a9d6b011c997 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.dictionary.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageAccountUpdateParametersTags : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray + { + protected global::System.Collections.Generic.Dictionary __additionalProperties = new global::System.Collections.Generic.Dictionary(); + + global::System.Collections.Generic.IDictionary Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.AdditionalProperties { get => __additionalProperties; } + + int Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Count { get => __additionalProperties.Count; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Keys { get => __additionalProperties.Keys; } + + global::System.Collections.Generic.IEnumerable Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray.Values { get => __additionalProperties.Values; } + + public string this[global::System.String index] { get => __additionalProperties[index]; set => __additionalProperties[index] = value; } + + /// + /// + public void Add(global::System.String key, string value) => __additionalProperties.Add( key, value); + + public void Clear() => __additionalProperties.Clear(); + + /// + public bool ContainsKey(global::System.String key) => __additionalProperties.ContainsKey( key); + + /// + public void CopyFrom(global::System.Collections.IDictionary source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public void CopyFrom(global::System.Management.Automation.PSObject source) + { + if (null != source) + { + foreach( var property in Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.TypeConverterExtensions.GetFilteredProperties(source, new global::System.Collections.Generic.HashSet() { } ) ) + { + if ((null != property.Key && null != property.Value)) + { + this.__additionalProperties.Add(property.Key.ToString(), global::System.Management.Automation.LanguagePrimitives.ConvertTo( property.Value)); + } + } + } + } + + /// + public bool Remove(global::System.String key) => __additionalProperties.Remove( key); + + /// + /// + public bool TryGetValue(global::System.String key, out string value) => __additionalProperties.TryGetValue( key, out value); + + /// + + public static implicit operator global::System.Collections.Generic.Dictionary(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParametersTags source) => source.__additionalProperties; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.json.cs new file mode 100644 index 000000000000..675a27079f90 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageAccountUpdateParametersTags.json.cs @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + public partial class StorageAccountUpdateParametersTags + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageAccountUpdateParametersTags(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + /// + internal StorageAccountUpdateParametersTags(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, global::System.Collections.Generic.HashSet exclusions = null) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson( json, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, null ,exclusions ); + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IAssociativeArray)this).AdditionalProperties, container); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.PowerShell.cs new file mode 100644 index 000000000000..fbe5806d568e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.PowerShell.cs @@ -0,0 +1,182 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(StorageQueueTypeConverter))] + public partial class StorageQueue + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageQueue(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageQueue(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageQueue(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueueProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("QueuePropertyMetadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("QueuePropertyApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyApproximateMessageCount = (int?) content.GetValueForProperty("QueuePropertyApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyApproximateMessageCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageQueue(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("QueueProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueueProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties) content.GetValueForProperty("QueueProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueueProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("QueuePropertyMetadata")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyMetadata = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) content.GetValueForProperty("QueuePropertyMetadata",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyMetadata, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueuePropertiesMetadataTypeConverter.ConvertFrom); + } + if (content.Contains("QueuePropertyApproximateMessageCount")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyApproximateMessageCount = (int?) content.GetValueForProperty("QueuePropertyApproximateMessageCount",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal)this).QueuePropertyApproximateMessageCount, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(StorageQueueTypeConverter))] + public partial interface IStorageQueue + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.TypeConverter.cs new file mode 100644 index 000000000000..f0c51b5bfcac --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageQueueTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageQueue.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageQueue.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageQueue.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.cs new file mode 100644 index 000000000000..de75db227411 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageQueue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for QueueProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal.QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueProperties()); set { {_queueProperty = value;} } } + + /// Internal Acessors for QueuePropertyApproximateMessageCount + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueueInternal.QueuePropertyApproximateMessageCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)QueueProperty).ApproximateMessageCount; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)QueueProperty).ApproximateMessageCount = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties _queueProperty; + + /// Queue resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties QueueProperty { get => (this._queueProperty = this._queueProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueProperties()); set => this._queueProperty = value; } + + /// + /// Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of + /// messages in the queue, but could be higher. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public int? QueuePropertyApproximateMessageCount { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)QueueProperty).ApproximateMessageCount; } + + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata QueuePropertyMetadata { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)QueueProperty).Metadata; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesInternal)QueueProperty).Metadata = value ?? null /* model class */; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public StorageQueue() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + public partial interface IStorageQueue : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// + /// Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of + /// messages in the queue, but could be higher. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher.", + SerializedName = @"approximateMessageCount", + PossibleTypes = new [] { typeof(int) })] + int? QueuePropertyApproximateMessageCount { get; } + /// A name-value pair that represents queue metadata. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair that represents queue metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata QueuePropertyMetadata { get; set; } + + } + internal partial interface IStorageQueueInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// Queue resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueProperties QueueProperty { get; set; } + /// + /// Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of + /// messages in the queue, but could be higher. + /// + int? QueuePropertyApproximateMessageCount { get; set; } + /// A name-value pair that represents queue metadata. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata QueuePropertyMetadata { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.json.cs new file mode 100644 index 000000000000..664419c2669f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageQueue.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageQueue + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageQueue(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageQueue(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_queueProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueProperties.FromJson(__jsonProperties) : QueueProperty;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._queueProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._queueProperty.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.PowerShell.cs new file mode 100644 index 000000000000..226b53d2617f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The response from the List Storage SKUs operation. + [System.ComponentModel.TypeConverter(typeof(StorageSkuListResultTypeConverter))] + public partial class StorageSkuListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageSkuListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageSkuListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageSkuListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuInformationTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageSkuListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuInformationTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The response from the List Storage SKUs operation. + [System.ComponentModel.TypeConverter(typeof(StorageSkuListResultTypeConverter))] + public partial interface IStorageSkuListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.TypeConverter.cs new file mode 100644 index 000000000000..9209b89980ea --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageSkuListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageSkuListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageSkuListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageSkuListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.cs new file mode 100644 index 000000000000..39691ad77adf --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Storage SKUs operation. + public partial class StorageSkuListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResultInternal + { + + /// Internal Acessors for Value + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation[] Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResultInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation[] _value; + + /// Get the list result of storage SKUs and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation[] Value { get => this._value; } + + /// Creates an new instance. + public StorageSkuListResult() + { + + } + } + /// The response from the List Storage SKUs operation. + public partial interface IStorageSkuListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Get the list result of storage SKUs and their properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Get the list result of storage SKUs and their properties.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation[] Value { get; } + + } + /// The response from the List Storage SKUs operation. + internal partial interface IStorageSkuListResultInternal + + { + /// Get the list result of storage SKUs and their properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.json.cs new file mode 100644 index 000000000000..5bf602a625c2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/StorageSkuListResult.json.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Storage SKUs operation. + public partial class StorageSkuListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageSkuListResult(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageSkuListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.SkuInformation.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Table.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Table.PowerShell.cs new file mode 100644 index 000000000000..5c5a384a4e7a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Table.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Properties of the table, including Id, resource name, resource type. + [System.ComponentModel.TypeConverter(typeof(TableTypeConverter))] + public partial class Table + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Table(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Table(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Table(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TablePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PropertyTableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertyTableName = (string) content.GetValueForProperty("PropertyTableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertyTableName, global::System.Convert.ToString); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableSignedIdentifierTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Table(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Property")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).Property = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties) content.GetValueForProperty("Property",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).Property, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TablePropertiesTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("PropertyTableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertyTableName = (string) content.GetValueForProperty("PropertyTableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertyTableName, global::System.Convert.ToString); + } + if (content.Contains("PropertySignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertySignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]) content.GetValueForProperty("PropertySignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal)this).PropertySignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableSignedIdentifierTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Properties of the table, including Id, resource name, resource type. + [System.ComponentModel.TypeConverter(typeof(TableTypeConverter))] + public partial interface ITable + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Table.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Table.TypeConverter.cs new file mode 100644 index 000000000000..5a66a8a0bad9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Table.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TableTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Table.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Table.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Table.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Table.cs b/swaggerci/storage/generated/api/Models/Api20220501/Table.cs new file mode 100644 index 000000000000..7ddd58ef53d9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Table.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the table, including Id, resource name, resource type. + public partial class Table : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for Property + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal.Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableProperties()); set { {_property = value;} } } + + /// Internal Acessors for PropertyTableName + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableInternal.PropertyTableName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)Property).TableName; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)Property).TableName = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties _property; + + /// Table resource properties. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties Property { get => (this._property = this._property ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableProperties()); set => this._property = value; } + + /// List of stored access policies specified on the table. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] PropertySignedIdentifier { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)Property).SignedIdentifier; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)Property).SignedIdentifier = value ?? null /* arrayOf */; } + + /// Table name under the specified account + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string PropertyTableName { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)Property).TableName; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public Table() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// Properties of the table, including Id, resource name, resource type. + public partial interface ITable : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// List of stored access policies specified on the table. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the table.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] PropertySignedIdentifier { get; set; } + /// Table name under the specified account + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Table name under the specified account", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string PropertyTableName { get; } + + } + /// Properties of the table, including Id, resource name, resource type. + internal partial interface ITableInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// Table resource properties. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties Property { get; set; } + /// List of stored access policies specified on the table. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] PropertySignedIdentifier { get; set; } + /// Table name under the specified account + string PropertyTableName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Table.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Table.json.cs new file mode 100644 index 000000000000..793f3c16bdca --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Table.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Properties of the table, including Id, resource name, resource type. + public partial class Table + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Table(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Table(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_property = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableProperties.FromJson(__jsonProperties) : Property;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._property ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._property.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.PowerShell.cs new file mode 100644 index 000000000000..b972b890c5df --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Table Access Policy Properties Object. + [System.ComponentModel.TypeConverter(typeof(TableAccessPolicyTypeConverter))] + public partial class TableAccessPolicy + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TableAccessPolicy(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TableAccessPolicy(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TableAccessPolicy(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).ExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).Permission, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TableAccessPolicy(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("StartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).StartTime = (global::System.DateTime?) content.GetValueForProperty("StartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).StartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).ExpiryTime = (global::System.DateTime?) content.GetValueForProperty("ExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).ExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("Permission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).Permission = (string) content.GetValueForProperty("Permission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)this).Permission, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Table Access Policy Properties Object. + [System.ComponentModel.TypeConverter(typeof(TableAccessPolicyTypeConverter))] + public partial interface ITableAccessPolicy + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.TypeConverter.cs new file mode 100644 index 000000000000..0965021f6474 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TableAccessPolicyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TableAccessPolicy.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TableAccessPolicy.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TableAccessPolicy.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.cs new file mode 100644 index 000000000000..f9f7ec69a240 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Table Access Policy Properties Object. + public partial class TableAccessPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal + { + + /// Backing field for property. + private global::System.DateTime? _expiryTime; + + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? ExpiryTime { get => this._expiryTime; set => this._expiryTime = value; } + + /// Backing field for property. + private string _permission; + + /// + /// Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Permission { get => this._permission; set => this._permission = value; } + + /// Backing field for property. + private global::System.DateTime? _startTime; + + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? StartTime { get => this._startTime; set => this._startTime = value; } + + /// Creates an new instance. + public TableAccessPolicy() + { + + } + } + /// Table Access Policy Properties Object. + public partial interface ITableAccessPolicy : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of the access policy", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? ExpiryTime { get; set; } + /// + /// Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d'", + SerializedName = @"permission", + PossibleTypes = new [] { typeof(string) })] + string Permission { get; set; } + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of the access policy", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? StartTime { get; set; } + + } + /// Table Access Policy Properties Object. + internal partial interface ITableAccessPolicyInternal + + { + /// Expiry time of the access policy + global::System.DateTime? ExpiryTime { get; set; } + /// + /// Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + /// + string Permission { get; set; } + /// Start time of the access policy + global::System.DateTime? StartTime { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.json.cs new file mode 100644 index 000000000000..d94d4b551c02 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableAccessPolicy.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Table Access Policy Properties Object. + public partial class TableAccessPolicy + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TableAccessPolicy(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TableAccessPolicy(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_startTime = If( json?.PropertyT("startTime"), out var __jsonStartTime) ? global::System.DateTime.TryParse((string)__jsonStartTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonStartTimeValue) ? __jsonStartTimeValue : StartTime : StartTime;} + {_expiryTime = If( json?.PropertyT("expiryTime"), out var __jsonExpiryTime) ? global::System.DateTime.TryParse((string)__jsonExpiryTime, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonExpiryTimeValue) ? __jsonExpiryTimeValue : ExpiryTime : ExpiryTime;} + {_permission = If( json?.PropertyT("permission"), out var __jsonPermission) ? (string)__jsonPermission : (string)Permission;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._startTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._startTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "startTime" ,container.Add ); + AddIf( null != this._expiryTime ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._expiryTime?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "expiryTime" ,container.Add ); + AddIf( null != (((object)this._permission)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._permission.ToString()) : null, "permission" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.PowerShell.cs new file mode 100644 index 000000000000..59b542270b8f --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.PowerShell.cs @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(TablePropertiesTypeConverter))] + public partial class TableProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TableProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TableProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TableProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableSignedIdentifierTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TableProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("SignedIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).SignedIdentifier = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[]) content.GetValueForProperty("SignedIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal)this).SignedIdentifier, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableSignedIdentifierTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(TablePropertiesTypeConverter))] + public partial interface ITableProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.TypeConverter.cs new file mode 100644 index 000000000000..fc125216eceb --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TablePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TableProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TableProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TableProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.cs new file mode 100644 index 000000000000..f72fa301f035 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.cs @@ -0,0 +1,68 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class TableProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal + { + + /// Internal Acessors for TableName + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITablePropertiesInternal.TableName { get => this._tableName; set { {_tableName = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] _signedIdentifier; + + /// List of stored access policies specified on the table. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] SignedIdentifier { get => this._signedIdentifier; set => this._signedIdentifier = value; } + + /// Backing field for property. + private string _tableName; + + /// Table name under the specified account + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TableName { get => this._tableName; } + + /// Creates an new instance. + public TableProperties() + { + + } + } + public partial interface ITableProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// List of stored access policies specified on the table. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the table.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] SignedIdentifier { get; set; } + /// Table name under the specified account + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Table name under the specified account", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string TableName { get; } + + } + internal partial interface ITablePropertiesInternal + + { + /// List of stored access policies specified on the table. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] SignedIdentifier { get; set; } + /// Table name under the specified account + string TableName { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.json.cs new file mode 100644 index 000000000000..551bc8895b25 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableProperties.json.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class TableProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TableProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TableProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_signedIdentifier = If( json?.PropertyT("signedIdentifiers"), out var __jsonSignedIdentifiers) ? If( __jsonSignedIdentifiers as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableSignedIdentifier.FromJson(__u) )) ))() : null : SignedIdentifier;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tableName.ToString()) : null, "tableName" ,container.Add ); + } + if (null != this._signedIdentifier) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._signedIdentifier ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("signedIdentifiers",__w); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.PowerShell.cs new file mode 100644 index 000000000000..9df6fe081d9a --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a storage account’s Table service. + [System.ComponentModel.TypeConverter(typeof(TableServicePropertiesTypeConverter))] + public partial class TableServiceProperties + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TableServiceProperties(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TableServiceProperties(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TableServiceProperties(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated) content.GetValueForProperty("TableServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("TableServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("TableServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TableServiceProperties(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("TableServiceProperty")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServiceProperty = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated) content.GetValueForProperty("TableServiceProperty",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServiceProperty, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServicePropertiesAutoGeneratedTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Type")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type = (string) content.GetValueForProperty("Type",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)this).Type, global::System.Convert.ToString); + } + if (content.Contains("TableServicePropertyCor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServicePropertyCor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("TableServicePropertyCor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).TableServicePropertyCor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a storage account’s Table service. + [System.ComponentModel.TypeConverter(typeof(TableServicePropertiesTypeConverter))] + public partial interface ITableServiceProperties + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.TypeConverter.cs new file mode 100644 index 000000000000..2dad3918630c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TableServicePropertiesTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TableServiceProperties.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TableServiceProperties.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TableServiceProperties.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.cs new file mode 100644 index 000000000000..1a6edad7fe41 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Table service. + public partial class TableServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates + { + /// + /// Backing field for Inherited model + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(); + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)TableServiceProperty).CorCorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)TableServiceProperty).CorCorsRule = value ?? null /* arrayOf */; } + + /// + /// Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; } + + /// Internal Acessors for Id + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Id { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Id = value; } + + /// Internal Acessors for Name + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name = value; } + + /// Internal Acessors for Type + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal.Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type = value; } + + /// Internal Acessors for TableServiceProperty + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal.TableServiceProperty { get => (this._tableServiceProperty = this._tableServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServicePropertiesAutoGenerated()); set { {_tableServiceProperty = value;} } } + + /// Internal Acessors for TableServicePropertyCor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesInternal.TableServicePropertyCor { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)TableServiceProperty).Cor; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)TableServiceProperty).Cor = value; } + + /// The name of the resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Name { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Name; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated _tableServiceProperty; + + /// The properties of a storage account’s Table service. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated TableServiceProperty { get => (this._tableServiceProperty = this._tableServiceProperty ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServicePropertiesAutoGenerated()); set => this._tableServiceProperty = value; } + + /// + /// The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inherited)] + public string Type { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal)__resource).Type; } + + /// Creates an new instance. + public TableServiceProperties() + { + + } + + /// Validates that this object meets the validation criteria. + /// an instance that will receive validation + /// events. + /// + /// A that will be complete when validation is completed. + /// + public async global::System.Threading.Tasks.Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + await eventListener.AssertNotNull(nameof(__resource), __resource); + await eventListener.AssertObjectIsValid(nameof(__resource), __resource); + } + } + /// The properties of a storage account’s Table service. + public partial interface ITableServiceProperties : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResource + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + + } + /// The properties of a storage account’s Table service. + internal partial interface ITableServicePropertiesInternal : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.IResourceInternal + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + /// The properties of a storage account’s Table service. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated TableServiceProperty { get; set; } + /// + /// Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules TableServicePropertyCor { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.json.cs new file mode 100644 index 000000000000..8241e0c96990 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServiceProperties.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Table service. + public partial class TableServiceProperties + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TableServiceProperties(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TableServiceProperties(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + __resource = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api10.Resource(json); + {_tableServiceProperty = If( json?.PropertyT("properties"), out var __jsonProperties) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServicePropertiesAutoGenerated.FromJson(__jsonProperties) : TableServiceProperty;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + __resource?.ToJson(container, serializationMode); + AddIf( null != this._tableServiceProperty ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._tableServiceProperty.ToJson(null,serializationMode) : null, "properties" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.PowerShell.cs new file mode 100644 index 000000000000..726d1a44f8ee --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.PowerShell.cs @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The properties of a storage account’s Table service. + [System.ComponentModel.TypeConverter(typeof(TableServicePropertiesAutoGeneratedTypeConverter))] + public partial class TableServicePropertiesAutoGenerated + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TableServicePropertiesAutoGenerated(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TableServicePropertiesAutoGenerated(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// + /// an instance of the model class. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TableServicePropertiesAutoGenerated(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TableServicePropertiesAutoGenerated(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Cor")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).Cor = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules) content.GetValueForProperty("Cor",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).Cor, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRulesTypeConverter.ConvertFrom); + } + if (content.Contains("CorCorsRule")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[]) content.GetValueForProperty("CorCorsRule",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal)this).CorCorsRule, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRuleTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// The properties of a storage account’s Table service. + [System.ComponentModel.TypeConverter(typeof(TableServicePropertiesAutoGeneratedTypeConverter))] + public partial interface ITableServicePropertiesAutoGenerated + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.TypeConverter.cs new file mode 100644 index 000000000000..e08af545f346 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.TypeConverter.cs @@ -0,0 +1,149 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TableServicePropertiesAutoGeneratedTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise + /// false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TableServicePropertiesAutoGenerated.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TableServicePropertiesAutoGenerated.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TableServicePropertiesAutoGenerated.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.cs new file mode 100644 index 000000000000..ddcd4a846fb1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Table service. + public partial class TableServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules _cor; + + /// + /// Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set => this._cor = value; } + + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRulesInternal)Cor).CorsRule = value ?? null /* arrayOf */; } + + /// Internal Acessors for Cor + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGeneratedInternal.Cor { get => (this._cor = this._cor ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules()); set { {_cor = value;} } } + + /// Creates an new instance. + public TableServicePropertiesAutoGenerated() + { + + } + } + /// The properties of a storage account’s Table service. + public partial interface ITableServicePropertiesAutoGenerated : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The List of CORS rules. You can include up to five CorsRule elements in the request. ", + SerializedName = @"corsRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + + } + /// The properties of a storage account’s Table service. + internal partial interface ITableServicePropertiesAutoGeneratedInternal + + { + /// + /// Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule + /// elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRules Cor { get; set; } + /// + /// The List of CORS rules. You can include up to five CorsRule elements in the request. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICorsRule[] CorCorsRule { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.json.cs new file mode 100644 index 000000000000..fefd9553e994 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableServicePropertiesAutoGenerated.json.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The properties of a storage account’s Table service. + public partial class TableServicePropertiesAutoGenerated + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServicePropertiesAutoGenerated FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TableServicePropertiesAutoGenerated(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TableServicePropertiesAutoGenerated(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_cor = If( json?.PropertyT("cors"), out var __jsonCors) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CorsRules.FromJson(__jsonCors) : Cor;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._cor ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._cor.ToJson(null,serializationMode) : null, "cors" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.PowerShell.cs new file mode 100644 index 000000000000..757e242041e3 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Object to set Table Access Policy. + [System.ComponentModel.TypeConverter(typeof(TableSignedIdentifierTypeConverter))] + public partial class TableSignedIdentifier + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TableSignedIdentifier(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TableSignedIdentifier(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TableSignedIdentifier(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableAccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyPermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyPermission, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TableSignedIdentifier(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("AccessPolicy")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicy = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy) content.GetValueForProperty("AccessPolicy",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicy, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableAccessPolicyTypeConverter.ConvertFrom); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).Id, global::System.Convert.ToString); + } + if (content.Contains("AccessPolicyStartTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyStartTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyStartTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyStartTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyExpiryTime")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyExpiryTime = (global::System.DateTime?) content.GetValueForProperty("AccessPolicyExpiryTime",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyExpiryTime, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("AccessPolicyPermission")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyPermission = (string) content.GetValueForProperty("AccessPolicyPermission",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal)this).AccessPolicyPermission, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Object to set Table Access Policy. + [System.ComponentModel.TypeConverter(typeof(TableSignedIdentifierTypeConverter))] + public partial interface ITableSignedIdentifier + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.TypeConverter.cs new file mode 100644 index 000000000000..692a776179c5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TableSignedIdentifierTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TableSignedIdentifier.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TableSignedIdentifier.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TableSignedIdentifier.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.cs new file mode 100644 index 000000000000..f74d86e39a03 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Object to set Table Access Policy. + public partial class TableSignedIdentifier : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy _accessPolicy; + + /// Access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableAccessPolicy()); set => this._accessPolicy = value; } + + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? AccessPolicyExpiryTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)AccessPolicy).ExpiryTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)AccessPolicy).ExpiryTime = value ?? default(global::System.DateTime); } + + /// + /// Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string AccessPolicyPermission { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)AccessPolicy).Permission; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)AccessPolicy).Permission = value ?? null; } + + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public global::System.DateTime? AccessPolicyStartTime { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)AccessPolicy).StartTime; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicyInternal)AccessPolicy).StartTime = value ?? default(global::System.DateTime); } + + /// Backing field for property. + private string _id; + + /// unique-64-character-value of the stored access policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Internal Acessors for AccessPolicy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifierInternal.AccessPolicy { get => (this._accessPolicy = this._accessPolicy ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableAccessPolicy()); set { {_accessPolicy = value;} } } + + /// Creates an new instance. + public TableSignedIdentifier() + { + + } + } + /// Object to set Table Access Policy. + public partial interface ITableSignedIdentifier : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Expiry time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Expiry time of the access policy", + SerializedName = @"expiryTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AccessPolicyExpiryTime { get; set; } + /// + /// Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d'", + SerializedName = @"permission", + PossibleTypes = new [] { typeof(string) })] + string AccessPolicyPermission { get; set; } + /// Start time of the access policy + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Start time of the access policy", + SerializedName = @"startTime", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? AccessPolicyStartTime { get; set; } + /// unique-64-character-value of the stored access policy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"unique-64-character-value of the stored access policy.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + + } + /// Object to set Table Access Policy. + internal partial interface ITableSignedIdentifierInternal + + { + /// Access policy + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableAccessPolicy AccessPolicy { get; set; } + /// Expiry time of the access policy + global::System.DateTime? AccessPolicyExpiryTime { get; set; } + /// + /// Required. List of abbreviated permissions. Supported permission values include 'r','a','u','d' + /// + string AccessPolicyPermission { get; set; } + /// Start time of the access policy + global::System.DateTime? AccessPolicyStartTime { get; set; } + /// unique-64-character-value of the stored access policy. + string Id { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.json.cs new file mode 100644 index 000000000000..7f718a052f13 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TableSignedIdentifier.json.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Object to set Table Access Policy. + public partial class TableSignedIdentifier + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TableSignedIdentifier(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TableSignedIdentifier(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_accessPolicy = If( json?.PropertyT("accessPolicy"), out var __jsonAccessPolicy) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableAccessPolicy.FromJson(__jsonAccessPolicy) : AccessPolicy;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != this._accessPolicy ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._accessPolicy.ToJson(null,serializationMode) : null, "accessPolicy" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.PowerShell.cs new file mode 100644 index 000000000000..c053fb8d7da4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Blob index tag based filtering for blob objects + [System.ComponentModel.TypeConverter(typeof(TagFilterTypeConverter))] + public partial class TagFilter + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TagFilter(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TagFilter(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TagFilter(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Op")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Op = (string) content.GetValueForProperty("Op",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Op, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TagFilter(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Name = (string) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Name, global::System.Convert.ToString); + } + if (content.Contains("Op")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Op = (string) content.GetValueForProperty("Op",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Op, global::System.Convert.ToString); + } + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal)this).Value, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// Blob index tag based filtering for blob objects + [System.ComponentModel.TypeConverter(typeof(TagFilterTypeConverter))] + public partial interface ITagFilter + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.TypeConverter.cs new file mode 100644 index 000000000000..acf73f6ecc18 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TagFilterTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TagFilter.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TagFilter.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TagFilter.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.cs new file mode 100644 index 000000000000..9f9984e25407 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob index tag based filtering for blob objects + public partial class TagFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilterInternal + { + + /// Backing field for property. + private string _name; + + /// This is the filter tag name, it can have 1 - 128 characters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Name { get => this._name; set => this._name = value; } + + /// Backing field for property. + private string _op; + + /// + /// This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently + /// supported + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Op { get => this._op; set => this._op = value; } + + /// Backing field for property. + private string _value; + + /// + /// This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public TagFilter() + { + + } + } + /// Blob index tag based filtering for blob objects + public partial interface ITagFilter : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// This is the filter tag name, it can have 1 - 128 characters + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is the filter tag name, it can have 1 - 128 characters", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + string Name { get; set; } + /// + /// This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently + /// supported + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently supported", + SerializedName = @"op", + PossibleTypes = new [] { typeof(string) })] + string Op { get; set; } + /// + /// This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; set; } + + } + /// Blob index tag based filtering for blob objects + internal partial interface ITagFilterInternal + + { + /// This is the filter tag name, it can have 1 - 128 characters + string Name { get; set; } + /// + /// This is the comparison operator which is used for object comparison and filtering. Only == (equality operator) is currently + /// supported + /// + string Op { get; set; } + /// + /// This is the filter tag value field used for tag based filtering, it can have 0 - 256 characters + /// + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.json.cs new file mode 100644 index 000000000000..0aa746529a34 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagFilter.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Blob index tag based filtering for blob objects + public partial class TagFilter + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagFilter FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TagFilter(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TagFilter(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? (string)__jsonName : (string)Name;} + {_op = If( json?.PropertyT("op"), out var __jsonOp) ? (string)__jsonOp : (string)Op;} + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._name)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._name.ToString()) : null, "name" ,container.Add ); + AddIf( null != (((object)this._op)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._op.ToString()) : null, "op" ,container.Add ); + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.PowerShell.cs new file mode 100644 index 000000000000..72e264677efc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.PowerShell.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// A tag of the LegalHold of a blob container. + [System.ComponentModel.TypeConverter(typeof(TagPropertyTypeConverter))] + public partial class TagProperty + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new TagProperty(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new TagProperty(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal TagProperty(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Tag, global::System.Convert.ToString); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Timestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Upn, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal TagProperty(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Tag")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Tag = (string) content.GetValueForProperty("Tag",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Tag, global::System.Convert.ToString); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Timestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal)this).Upn, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + /// A tag of the LegalHold of a blob container. + [System.ComponentModel.TypeConverter(typeof(TagPropertyTypeConverter))] + public partial interface ITagProperty + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.TypeConverter.cs new file mode 100644 index 000000000000..81824fe541f9 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class TagPropertyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return TagProperty.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return TagProperty.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return TagProperty.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.cs new file mode 100644 index 000000000000..e4fda89675e5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A tag of the LegalHold of a blob container. + public partial class TagProperty : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal + { + + /// Internal Acessors for ObjectIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal.ObjectIdentifier { get => this._objectIdentifier; set { {_objectIdentifier = value;} } } + + /// Internal Acessors for Tag + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal.Tag { get => this._tag; set { {_tag = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Internal Acessors for Timestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal.Timestamp { get => this._timestamp; set { {_timestamp = value;} } } + + /// Internal Acessors for Upn + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagPropertyInternal.Upn { get => this._upn; set { {_upn = value;} } } + + /// Backing field for property. + private string _objectIdentifier; + + /// Returns the Object ID of the user who added the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ObjectIdentifier { get => this._objectIdentifier; } + + /// Backing field for property. + private string _tag; + + /// The tag value. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Tag { get => this._tag; } + + /// Backing field for property. + private string _tenantId; + + /// Returns the Tenant ID that issued the token for the user who added the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private global::System.DateTime? _timestamp; + + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? Timestamp { get => this._timestamp; } + + /// Backing field for property. + private string _upn; + + /// Returns the User Principal Name of the user who added the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Upn { get => this._upn; } + + /// Creates an new instance. + public TagProperty() + { + + } + } + /// A tag of the LegalHold of a blob container. + public partial interface ITagProperty : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Returns the Object ID of the user who added the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the Object ID of the user who added the tag.", + SerializedName = @"objectIdentifier", + PossibleTypes = new [] { typeof(string) })] + string ObjectIdentifier { get; } + /// The tag value. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The tag value.", + SerializedName = @"tag", + PossibleTypes = new [] { typeof(string) })] + string Tag { get; } + /// Returns the Tenant ID that issued the token for the user who added the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the Tenant ID that issued the token for the user who added the tag.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// Returns the date and time the tag was added. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the tag was added.", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Timestamp { get; } + /// Returns the User Principal Name of the user who added the tag. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the User Principal Name of the user who added the tag.", + SerializedName = @"upn", + PossibleTypes = new [] { typeof(string) })] + string Upn { get; } + + } + /// A tag of the LegalHold of a blob container. + internal partial interface ITagPropertyInternal + + { + /// Returns the Object ID of the user who added the tag. + string ObjectIdentifier { get; set; } + /// The tag value. + string Tag { get; set; } + /// Returns the Tenant ID that issued the token for the user who added the tag. + string TenantId { get; set; } + /// Returns the date and time the tag was added. + global::System.DateTime? Timestamp { get; set; } + /// Returns the User Principal Name of the user who added the tag. + string Upn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.json.cs new file mode 100644 index 000000000000..92a506b25c04 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/TagProperty.json.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// A tag of the LegalHold of a blob container. + public partial class TagProperty + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITagProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new TagProperty(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal TagProperty(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_tag = If( json?.PropertyT("tag"), out var __jsonTag) ? (string)__jsonTag : (string)Tag;} + {_timestamp = If( json?.PropertyT("timestamp"), out var __jsonTimestamp) ? global::System.DateTime.TryParse((string)__jsonTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimestampValue) ? __jsonTimestampValue : Timestamp : Timestamp;} + {_objectIdentifier = If( json?.PropertyT("objectIdentifier"), out var __jsonObjectIdentifier) ? (string)__jsonObjectIdentifier : (string)ObjectIdentifier;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_upn = If( json?.PropertyT("upn"), out var __jsonUpn) ? (string)__jsonUpn : (string)Upn;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tag)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tag.ToString()) : null, "tag" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._timestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._timestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timestamp" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectIdentifier.ToString()) : null, "objectIdentifier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._upn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._upn.ToString()) : null, "upn" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.PowerShell.cs new file mode 100644 index 000000000000..b9909f04d7fa --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.PowerShell.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// An update history of the ImmutabilityPolicy of a blob container. + [System.ComponentModel.TypeConverter(typeof(UpdateHistoryPropertyTypeConverter))] + public partial class UpdateHistoryProperty + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UpdateHistoryProperty(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UpdateHistoryProperty(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UpdateHistoryProperty(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Update")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType?) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Update, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType.CreateFrom); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Timestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Upn, global::System.Convert.ToString); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UpdateHistoryProperty(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Update")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Update = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType?) content.GetValueForProperty("Update",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Update, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType.CreateFrom); + } + if (content.Contains("ImmutabilityPeriodSinceCreationInDay")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay = (int?) content.GetValueForProperty("ImmutabilityPeriodSinceCreationInDay",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ImmutabilityPeriodSinceCreationInDay, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Timestamp")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Timestamp = (global::System.DateTime?) content.GetValueForProperty("Timestamp",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Timestamp, (v) => v is global::System.DateTime _v ? _v : global::System.Xml.XmlConvert.ToDateTime( v.ToString() , global::System.Xml.XmlDateTimeSerializationMode.Unspecified)); + } + if (content.Contains("ObjectIdentifier")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier = (string) content.GetValueForProperty("ObjectIdentifier",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).ObjectIdentifier, global::System.Convert.ToString); + } + if (content.Contains("TenantId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).TenantId = (string) content.GetValueForProperty("TenantId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).TenantId, global::System.Convert.ToString); + } + if (content.Contains("Upn")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Upn = (string) content.GetValueForProperty("Upn",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).Upn, global::System.Convert.ToString); + } + if (content.Contains("AllowProtectedAppendWrite")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite = (bool?) content.GetValueForProperty("AllowProtectedAppendWrite",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWrite, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + if (content.Contains("AllowProtectedAppendWritesAll")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWritesAll = (bool?) content.GetValueForProperty("AllowProtectedAppendWritesAll",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal)this).AllowProtectedAppendWritesAll, (__y)=> (bool) global::System.Convert.ChangeType(__y, typeof(bool))); + } + AfterDeserializePSObject(content); + } + } + /// An update history of the ImmutabilityPolicy of a blob container. + [System.ComponentModel.TypeConverter(typeof(UpdateHistoryPropertyTypeConverter))] + public partial interface IUpdateHistoryProperty + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.TypeConverter.cs new file mode 100644 index 000000000000..4330d8c821c5 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UpdateHistoryPropertyTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UpdateHistoryProperty.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UpdateHistoryProperty.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UpdateHistoryProperty.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.cs b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.cs new file mode 100644 index 000000000000..14e1209a3897 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An update history of the ImmutabilityPolicy of a blob container. + public partial class UpdateHistoryProperty : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal + { + + /// Backing field for property. + private bool? _allowProtectedAppendWrite; + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowProtectedAppendWrite { get => this._allowProtectedAppendWrite; set => this._allowProtectedAppendWrite = value; } + + /// Backing field for property. + private bool? _allowProtectedAppendWritesAll; + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public bool? AllowProtectedAppendWritesAll { get => this._allowProtectedAppendWritesAll; set => this._allowProtectedAppendWritesAll = value; } + + /// Backing field for property. + private int? _immutabilityPeriodSinceCreationInDay; + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? ImmutabilityPeriodSinceCreationInDay { get => this._immutabilityPeriodSinceCreationInDay; } + + /// Internal Acessors for ImmutabilityPeriodSinceCreationInDay + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal.ImmutabilityPeriodSinceCreationInDay { get => this._immutabilityPeriodSinceCreationInDay; set { {_immutabilityPeriodSinceCreationInDay = value;} } } + + /// Internal Acessors for ObjectIdentifier + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal.ObjectIdentifier { get => this._objectIdentifier; set { {_objectIdentifier = value;} } } + + /// Internal Acessors for TenantId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal.TenantId { get => this._tenantId; set { {_tenantId = value;} } } + + /// Internal Acessors for Timestamp + global::System.DateTime? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal.Timestamp { get => this._timestamp; set { {_timestamp = value;} } } + + /// Internal Acessors for Update + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal.Update { get => this._update; set { {_update = value;} } } + + /// Internal Acessors for Upn + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryPropertyInternal.Upn { get => this._upn; set { {_upn = value;} } } + + /// Backing field for property. + private string _objectIdentifier; + + /// Returns the Object ID of the user who updated the ImmutabilityPolicy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ObjectIdentifier { get => this._objectIdentifier; } + + /// Backing field for property. + private string _tenantId; + + /// + /// Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TenantId { get => this._tenantId; } + + /// Backing field for property. + private global::System.DateTime? _timestamp; + + /// Returns the date and time the ImmutabilityPolicy was updated. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public global::System.DateTime? Timestamp { get => this._timestamp; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType? _update; + + /// + /// The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType? Update { get => this._update; } + + /// Backing field for property. + private string _upn; + + /// Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Upn { get => this._upn; } + + /// Creates an new instance. + public UpdateHistoryProperty() + { + + } + } + /// An update history of the ImmutabilityPolicy of a blob container. + public partial interface IUpdateHistoryProperty : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(bool) })] + bool? AllowProtectedAppendWritesAll { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + int? ImmutabilityPeriodSinceCreationInDay { get; } + /// Returns the Object ID of the user who updated the ImmutabilityPolicy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the Object ID of the user who updated the ImmutabilityPolicy.", + SerializedName = @"objectIdentifier", + PossibleTypes = new [] { typeof(string) })] + string ObjectIdentifier { get; } + /// + /// Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy.", + SerializedName = @"tenantId", + PossibleTypes = new [] { typeof(string) })] + string TenantId { get; } + /// Returns the date and time the ImmutabilityPolicy was updated. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the date and time the ImmutabilityPolicy was updated.", + SerializedName = @"timestamp", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + global::System.DateTime? Timestamp { get; } + /// + /// The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend.", + SerializedName = @"update", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType? Update { get; } + /// Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Returns the User Principal Name of the user who updated the ImmutabilityPolicy.", + SerializedName = @"upn", + PossibleTypes = new [] { typeof(string) })] + string Upn { get; } + + } + /// An update history of the ImmutabilityPolicy of a blob container. + internal partial interface IUpdateHistoryPropertyInternal + + { + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + bool? AllowProtectedAppendWrite { get; set; } + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + bool? AllowProtectedAppendWritesAll { get; set; } + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + int? ImmutabilityPeriodSinceCreationInDay { get; set; } + /// Returns the Object ID of the user who updated the ImmutabilityPolicy. + string ObjectIdentifier { get; set; } + /// + /// Returns the Tenant ID that issued the token for the user who updated the ImmutabilityPolicy. + /// + string TenantId { get; set; } + /// Returns the date and time the ImmutabilityPolicy was updated. + global::System.DateTime? Timestamp { get; set; } + /// + /// The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType? Update { get; set; } + /// Returns the User Principal Name of the user who updated the ImmutabilityPolicy. + string Upn { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.json.cs new file mode 100644 index 000000000000..b7d50d02bfdf --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UpdateHistoryProperty.json.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// An update history of the ImmutabilityPolicy of a blob container. + public partial class UpdateHistoryProperty + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUpdateHistoryProperty FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new UpdateHistoryProperty(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._update)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._update.ToString()) : null, "update" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._immutabilityPeriodSinceCreationInDay ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._immutabilityPeriodSinceCreationInDay) : null, "immutabilityPeriodSinceCreationInDays" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._timestamp ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._timestamp?.ToString(@"yyyy'-'MM'-'dd'T'HH':'mm':'ss.fffffffK",global::System.Globalization.CultureInfo.InvariantCulture)) : null, "timestamp" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._objectIdentifier)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectIdentifier.ToString()) : null, "objectIdentifier" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._tenantId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tenantId.ToString()) : null, "tenantId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._upn)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._upn.ToString()) : null, "upn" ,container.Add ); + } + AddIf( null != this._allowProtectedAppendWrite ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowProtectedAppendWrite) : null, "allowProtectedAppendWrites" ,container.Add ); + AddIf( null != this._allowProtectedAppendWritesAll ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonBoolean((bool)this._allowProtectedAppendWritesAll) : null, "allowProtectedAppendWritesAll" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal UpdateHistoryProperty(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_update = If( json?.PropertyT("update"), out var __jsonUpdate) ? (string)__jsonUpdate : (string)Update;} + {_immutabilityPeriodSinceCreationInDay = If( json?.PropertyT("immutabilityPeriodSinceCreationInDays"), out var __jsonImmutabilityPeriodSinceCreationInDays) ? (int?)__jsonImmutabilityPeriodSinceCreationInDays : ImmutabilityPeriodSinceCreationInDay;} + {_timestamp = If( json?.PropertyT("timestamp"), out var __jsonTimestamp) ? global::System.DateTime.TryParse((string)__jsonTimestamp, global::System.Globalization.CultureInfo.InvariantCulture, global::System.Globalization.DateTimeStyles.AdjustToUniversal, out var __jsonTimestampValue) ? __jsonTimestampValue : Timestamp : Timestamp;} + {_objectIdentifier = If( json?.PropertyT("objectIdentifier"), out var __jsonObjectIdentifier) ? (string)__jsonObjectIdentifier : (string)ObjectIdentifier;} + {_tenantId = If( json?.PropertyT("tenantId"), out var __jsonTenantId) ? (string)__jsonTenantId : (string)TenantId;} + {_upn = If( json?.PropertyT("upn"), out var __jsonUpn) ? (string)__jsonUpn : (string)Upn;} + {_allowProtectedAppendWrite = If( json?.PropertyT("allowProtectedAppendWrites"), out var __jsonAllowProtectedAppendWrites) ? (bool?)__jsonAllowProtectedAppendWrites : AllowProtectedAppendWrite;} + {_allowProtectedAppendWritesAll = If( json?.PropertyT("allowProtectedAppendWritesAll"), out var __jsonAllowProtectedAppendWritesAll) ? (bool?)__jsonAllowProtectedAppendWritesAll : AllowProtectedAppendWritesAll;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Usage.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/Usage.PowerShell.cs new file mode 100644 index 000000000000..33994de75989 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Usage.PowerShell.cs @@ -0,0 +1,184 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Describes Storage Resource Usage. + [System.ComponentModel.TypeConverter(typeof(UsageTypeConverter))] + public partial class Usage + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new Usage(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new Usage(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal Usage(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageNameTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit.CreateFrom); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).CurrentValue = (int?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).CurrentValue, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Limit = (int?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Limit, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal Usage(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Name")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Name = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName) content.GetValueForProperty("Name",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Name, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageNameTypeConverter.ConvertFrom); + } + if (content.Contains("Unit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Unit = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit?) content.GetValueForProperty("Unit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Unit, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit.CreateFrom); + } + if (content.Contains("CurrentValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).CurrentValue = (int?) content.GetValueForProperty("CurrentValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).CurrentValue, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("Limit")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Limit = (int?) content.GetValueForProperty("Limit",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).Limit, (__y)=> (int) global::System.Convert.ChangeType(__y, typeof(int))); + } + if (content.Contains("NameValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameValue = (string) content.GetValueForProperty("NameValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameValue, global::System.Convert.ToString); + } + if (content.Contains("NameLocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameLocalizedValue = (string) content.GetValueForProperty("NameLocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal)this).NameLocalizedValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// Describes Storage Resource Usage. + [System.ComponentModel.TypeConverter(typeof(UsageTypeConverter))] + public partial interface IUsage + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Usage.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/Usage.TypeConverter.cs new file mode 100644 index 000000000000..e10da237292c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Usage.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UsageTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return Usage.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return Usage.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return Usage.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Usage.cs b/swaggerci/storage/generated/api/Models/Api20220501/Usage.cs new file mode 100644 index 000000000000..6a79365ff244 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Usage.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Describes Storage Resource Usage. + public partial class Usage : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal + { + + /// Backing field for property. + private int? _currentValue; + + /// Gets the current count of the allocated resources in the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? CurrentValue { get => this._currentValue; } + + /// Backing field for property. + private int? _limit; + + /// + /// Gets the maximum count of the resources that can be allocated in the subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public int? Limit { get => this._limit; } + + /// Internal Acessors for CurrentValue + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal.CurrentValue { get => this._currentValue; set { {_currentValue = value;} } } + + /// Internal Acessors for Limit + int? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal.Limit { get => this._limit; set { {_limit = value;} } } + + /// Internal Acessors for Name + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal.Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageName()); set { {_name = value;} } } + + /// Internal Acessors for NameLocalizedValue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal.NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)Name).LocalizedValue; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)Name).LocalizedValue = value; } + + /// Internal Acessors for NameValue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal.NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)Name).Value; set => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)Name).Value = value; } + + /// Internal Acessors for Unit + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageInternal.Unit { get => this._unit; set { {_unit = value;} } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName _name; + + /// Gets the name of the type of usage. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + internal Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName Name { get => (this._name = this._name ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageName()); } + + /// Gets a localized string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NameLocalizedValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)Name).LocalizedValue; } + + /// Gets a string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Inlined)] + public string NameValue { get => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)Name).Value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit? _unit; + + /// Gets the unit of measurement. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit? Unit { get => this._unit; } + + /// Creates an new instance. + public Usage() + { + + } + } + /// Describes Storage Resource Usage. + public partial interface IUsage : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets the current count of the allocated resources in the subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the current count of the allocated resources in the subscription.", + SerializedName = @"currentValue", + PossibleTypes = new [] { typeof(int) })] + int? CurrentValue { get; } + /// + /// Gets the maximum count of the resources that can be allocated in the subscription. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the maximum count of the resources that can be allocated in the subscription.", + SerializedName = @"limit", + PossibleTypes = new [] { typeof(int) })] + int? Limit { get; } + /// Gets a localized string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a localized string describing the resource name.", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string NameLocalizedValue { get; } + /// Gets a string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a string describing the resource name.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string NameValue { get; } + /// Gets the unit of measurement. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets the unit of measurement.", + SerializedName = @"unit", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit? Unit { get; } + + } + /// Describes Storage Resource Usage. + internal partial interface IUsageInternal + + { + /// Gets the current count of the allocated resources in the subscription. + int? CurrentValue { get; set; } + /// + /// Gets the maximum count of the resources that can be allocated in the subscription. + /// + int? Limit { get; set; } + /// Gets the name of the type of usage. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName Name { get; set; } + /// Gets a localized string describing the resource name. + string NameLocalizedValue { get; set; } + /// Gets a string describing the resource name. + string NameValue { get; set; } + /// Gets the unit of measurement. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit? Unit { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/Usage.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/Usage.json.cs new file mode 100644 index 000000000000..5167599e3540 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/Usage.json.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Describes Storage Resource Usage. + public partial class Usage + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new Usage(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._name ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) this._name.ToJson(null,serializationMode) : null, "name" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._unit)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._unit.ToString()) : null, "unit" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._currentValue ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._currentValue) : null, "currentValue" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != this._limit ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode)new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNumber((int)this._limit) : null, "limit" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal Usage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_name = If( json?.PropertyT("name"), out var __jsonName) ? Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageName.FromJson(__jsonName) : Name;} + {_unit = If( json?.PropertyT("unit"), out var __jsonUnit) ? (string)__jsonUnit : (string)Unit;} + {_currentValue = If( json?.PropertyT("currentValue"), out var __jsonCurrentValue) ? (int?)__jsonCurrentValue : CurrentValue;} + {_limit = If( json?.PropertyT("limit"), out var __jsonLimit) ? (int?)__jsonLimit : Limit;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.PowerShell.cs new file mode 100644 index 000000000000..9563aff972c1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.PowerShell.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The response from the List Usages operation. + [System.ComponentModel.TypeConverter(typeof(UsageListResultTypeConverter))] + public partial class UsageListResult + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UsageListResult(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UsageListResult(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UsageListResult(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageTypeConverter.ConvertFrom)); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UsageListResult(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResultInternal)this).Value = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage[]) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResultInternal)this).Value, __y => TypeConverterExtensions.SelectToArray(__y, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageTypeConverter.ConvertFrom)); + } + AfterDeserializePSObject(content); + } + } + /// The response from the List Usages operation. + [System.ComponentModel.TypeConverter(typeof(UsageListResultTypeConverter))] + public partial interface IUsageListResult + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.TypeConverter.cs new file mode 100644 index 000000000000..7ff90e7ac4e1 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UsageListResultTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UsageListResult.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UsageListResult.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UsageListResult.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.cs new file mode 100644 index 000000000000..3fbebcda4306 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Usages operation. + public partial class UsageListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResultInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage[] _value; + + /// Gets or sets the list of Storage Resource Usages. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage[] Value { get => this._value; set => this._value = value; } + + /// Creates an new instance. + public UsageListResult() + { + + } + } + /// The response from the List Usages operation. + public partial interface IUsageListResult : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets or sets the list of Storage Resource Usages. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the list of Storage Resource Usages.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage[] Value { get; set; } + + } + /// The response from the List Usages operation. + internal partial interface IUsageListResultInternal + + { + /// Gets or sets the list of Storage Resource Usages. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage[] Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.json.cs new file mode 100644 index 000000000000..0484bc40d718 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageListResult.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The response from the List Usages operation. + public partial class UsageListResult + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new UsageListResult(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (null != this._value) + { + var __w = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.XNodeArray(); + foreach( var __x in this._value ) + { + AddIf(__x?.ToJson(null, serializationMode) ,__w.Add); + } + container.Add("value",__w); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal UsageListResult(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? If( __jsonValue as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonArray, out var __v) ? new global::System.Func(()=> global::System.Linq.Enumerable.ToArray(global::System.Linq.Enumerable.Select(__v, (__u)=>(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage) (Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Usage.FromJson(__u) )) ))() : null : Value;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageName.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.PowerShell.cs new file mode 100644 index 000000000000..33f40bc5de2e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// The usage names that can be used; currently limited to StorageAccount. + [System.ComponentModel.TypeConverter(typeof(UsageNameTypeConverter))] + public partial class UsageName + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UsageName(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UsageName(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UsageName(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).LocalizedValue, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UsageName(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("Value")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).Value = (string) content.GetValueForProperty("Value",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).Value, global::System.Convert.ToString); + } + if (content.Contains("LocalizedValue")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).LocalizedValue = (string) content.GetValueForProperty("LocalizedValue",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal)this).LocalizedValue, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// The usage names that can be used; currently limited to StorageAccount. + [System.ComponentModel.TypeConverter(typeof(UsageNameTypeConverter))] + public partial interface IUsageName + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageName.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.TypeConverter.cs new file mode 100644 index 000000000000..6d9c13a85fcc --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.TypeConverter.cs @@ -0,0 +1,146 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UsageNameTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UsageName.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UsageName.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UsageName.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageName.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.cs new file mode 100644 index 000000000000..84e70287e747 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The usage names that can be used; currently limited to StorageAccount. + public partial class UsageName : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal + { + + /// Backing field for property. + private string _localizedValue; + + /// Gets a localized string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string LocalizedValue { get => this._localizedValue; } + + /// Internal Acessors for LocalizedValue + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal.LocalizedValue { get => this._localizedValue; set { {_localizedValue = value;} } } + + /// Internal Acessors for Value + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageNameInternal.Value { get => this._value; set { {_value = value;} } } + + /// Backing field for property. + private string _value; + + /// Gets a string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Value { get => this._value; } + + /// Creates an new instance. + public UsageName() + { + + } + } + /// The usage names that can be used; currently limited to StorageAccount. + public partial interface IUsageName : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// Gets a localized string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a localized string describing the resource name.", + SerializedName = @"localizedValue", + PossibleTypes = new [] { typeof(string) })] + string LocalizedValue { get; } + /// Gets a string describing the resource name. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"Gets a string describing the resource name.", + SerializedName = @"value", + PossibleTypes = new [] { typeof(string) })] + string Value { get; } + + } + /// The usage names that can be used; currently limited to StorageAccount. + internal partial interface IUsageNameInternal + + { + /// Gets a localized string describing the resource name. + string LocalizedValue { get; set; } + /// Gets a string describing the resource name. + string Value { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UsageName.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.json.cs new file mode 100644 index 000000000000..23b90e03c92e --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UsageName.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// The usage names that can be used; currently limited to StorageAccount. + public partial class UsageName + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageName FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new UsageName(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._value)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._value.ToString()) : null, "value" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._localizedValue)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._localizedValue.ToString()) : null, "localizedValue" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal UsageName(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_value = If( json?.PropertyT("value"), out var __jsonValue) ? (string)__jsonValue : (string)Value;} + {_localizedValue = If( json?.PropertyT("localizedValue"), out var __jsonLocalizedValue) ? (string)__jsonLocalizedValue : (string)LocalizedValue;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.PowerShell.cs new file mode 100644 index 000000000000..6e2d79a4d206 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.PowerShell.cs @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// UserAssignedIdentity for the resource. + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] + public partial class UserAssignedIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new UserAssignedIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new UserAssignedIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal UserAssignedIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal UserAssignedIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("PrincipalId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).PrincipalId = (string) content.GetValueForProperty("PrincipalId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).PrincipalId, global::System.Convert.ToString); + } + if (content.Contains("ClientId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).ClientId = (string) content.GetValueForProperty("ClientId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal)this).ClientId, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + } + /// UserAssignedIdentity for the resource. + [System.ComponentModel.TypeConverter(typeof(UserAssignedIdentityTypeConverter))] + public partial interface IUserAssignedIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.TypeConverter.cs new file mode 100644 index 000000000000..2423eec64e86 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class UserAssignedIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return UserAssignedIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return UserAssignedIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return UserAssignedIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.cs b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.cs new file mode 100644 index 000000000000..980b3d6262a4 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// UserAssignedIdentity for the resource. + public partial class UserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal + { + + /// Backing field for property. + private string _clientId; + + /// The client ID of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ClientId { get => this._clientId; } + + /// Internal Acessors for ClientId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal.ClientId { get => this._clientId; set { {_clientId = value;} } } + + /// Internal Acessors for PrincipalId + string Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentityInternal.PrincipalId { get => this._principalId; set { {_principalId = value;} } } + + /// Backing field for property. + private string _principalId; + + /// The principal ID of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PrincipalId { get => this._principalId; } + + /// Creates an new instance. + public UserAssignedIdentity() + { + + } + } + /// UserAssignedIdentity for the resource. + public partial interface IUserAssignedIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The client ID of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The client ID of the identity.", + SerializedName = @"clientId", + PossibleTypes = new [] { typeof(string) })] + string ClientId { get; } + /// The principal ID of the identity. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = true, + Description = @"The principal ID of the identity.", + SerializedName = @"principalId", + PossibleTypes = new [] { typeof(string) })] + string PrincipalId { get; } + + } + /// UserAssignedIdentity for the resource. + internal partial interface IUserAssignedIdentityInternal + + { + /// The client ID of the identity. + string ClientId { get; set; } + /// The principal ID of the identity. + string PrincipalId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.json.cs new file mode 100644 index 000000000000..fd60e9cca751 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/UserAssignedIdentity.json.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// UserAssignedIdentity for the resource. + public partial class UserAssignedIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUserAssignedIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new UserAssignedIdentity(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._principalId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._principalId.ToString()) : null, "principalId" ,container.Add ); + } + if (serializationMode.HasFlag(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeReadOnly)) + { + AddIf( null != (((object)this._clientId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._clientId.ToString()) : null, "clientId" ,container.Add ); + } + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal UserAssignedIdentity(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_principalId = If( json?.PropertyT("principalId"), out var __jsonPrincipalId) ? (string)__jsonPrincipalId : (string)PrincipalId;} + {_clientId = If( json?.PropertyT("clientId"), out var __jsonClientId) ? (string)__jsonClientId : (string)ClientId;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.PowerShell.cs b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.PowerShell.cs new file mode 100644 index 000000000000..650d373f6781 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.PowerShell.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// Virtual Network rule. + [System.ComponentModel.TypeConverter(typeof(VirtualNetworkRuleTypeConverter))] + public partial class VirtualNetworkRule + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new VirtualNetworkRule(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new VirtualNetworkRule(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal VirtualNetworkRule(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VirtualNetworkResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId = (string) content.GetValueForProperty("VirtualNetworkResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State.CreateFrom); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal VirtualNetworkRule(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("VirtualNetworkResourceId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId = (string) content.GetValueForProperty("VirtualNetworkResourceId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).VirtualNetworkResourceId, global::System.Convert.ToString); + } + if (content.Contains("Action")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).Action = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action?) content.GetValueForProperty("Action",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).Action, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action.CreateFrom); + } + if (content.Contains("State")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).State = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State?) content.GetValueForProperty("State",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal)this).State, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State.CreateFrom); + } + AfterDeserializePSObject(content); + } + } + /// Virtual Network rule. + [System.ComponentModel.TypeConverter(typeof(VirtualNetworkRuleTypeConverter))] + public partial interface IVirtualNetworkRule + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.TypeConverter.cs b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.TypeConverter.cs new file mode 100644 index 000000000000..949de3a5796c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.TypeConverter.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class VirtualNetworkRuleTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return VirtualNetworkRule.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return VirtualNetworkRule.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return VirtualNetworkRule.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.cs b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.cs new file mode 100644 index 000000000000..ee32de08aa79 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Virtual Network rule. + public partial class VirtualNetworkRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRuleInternal + { + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? _action; + + /// The action of virtual network rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? Action { get => this._action; set => this._action = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State? _state; + + /// Gets the state of virtual network rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State? State { get => this._state; set => this._state = value; } + + /// Backing field for property. + private string _virtualNetworkResourceId; + + /// + /// Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string VirtualNetworkResourceId { get => this._virtualNetworkResourceId; set => this._virtualNetworkResourceId = value; } + + /// Creates an new instance. + public VirtualNetworkRule() + { + + } + } + /// Virtual Network rule. + public partial interface IVirtualNetworkRule : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// The action of virtual network rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The action of virtual network rule.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? Action { get; set; } + /// Gets the state of virtual network rule. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets the state of virtual network rule.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State? State { get; set; } + /// + /// Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}.", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string VirtualNetworkResourceId { get; set; } + + } + /// Virtual Network rule. + internal partial interface IVirtualNetworkRuleInternal + + { + /// The action of virtual network rule. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action? Action { get; set; } + /// Gets the state of virtual network rule. + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State? State { get; set; } + /// + /// Resource ID of a subnet, for example: /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName}. + /// + string VirtualNetworkResourceId { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.json.cs b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.json.cs new file mode 100644 index 000000000000..2b8d53ae44e2 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/Api20220501/VirtualNetworkRule.json.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501 +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// Virtual Network rule. + public partial class VirtualNetworkRule + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new VirtualNetworkRule(json) : null; + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._virtualNetworkResourceId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._virtualNetworkResourceId.ToString()) : null, "id" ,container.Add ); + AddIf( null != (((object)this._action)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._action.ToString()) : null, "action" ,container.Add ); + AddIf( null != (((object)this._state)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._state.ToString()) : null, "state" ,container.Add ); + AfterToJson(ref container); + return container; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal VirtualNetworkRule(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_virtualNetworkResourceId = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)VirtualNetworkResourceId;} + {_action = If( json?.PropertyT("action"), out var __jsonAction) ? (string)__jsonAction : (string)Action;} + {_state = If( json?.PropertyT("state"), out var __jsonState) ? (string)__jsonState : (string)State;} + AfterFromJson(json); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/StorageIdentity.PowerShell.cs b/swaggerci/storage/generated/api/Models/StorageIdentity.PowerShell.cs new file mode 100644 index 000000000000..7783310e1ac0 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/StorageIdentity.PowerShell.cs @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + [System.ComponentModel.TypeConverter(typeof(StorageIdentityTypeConverter))] + public partial class StorageIdentity + { + + /// + /// AfterDeserializeDictionary will be called after the deserialization has finished, allowing customization of the + /// object before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Collections.IDictionary content that should be used. + + partial void AfterDeserializeDictionary(global::System.Collections.IDictionary content); + + /// + /// AfterDeserializePSObject will be called after the deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The global::System.Management.Automation.PSObject content that should be used. + + partial void AfterDeserializePSObject(global::System.Management.Automation.PSObject content); + + /// + /// BeforeDeserializeDictionary will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Collections.IDictionary content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializeDictionary(global::System.Collections.IDictionary content, ref bool returnNow); + + /// + /// BeforeDeserializePSObject will be called before the deserialization has commenced, allowing complete customization + /// of the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeDeserializePSObject(global::System.Management.Automation.PSObject content, ref bool returnNow); + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity DeserializeFromDictionary(global::System.Collections.IDictionary content) + { + return new StorageIdentity(content); + } + + /// + /// Deserializes a into an instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + /// + /// an instance of . + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity DeserializeFromPSObject(global::System.Management.Automation.PSObject content) + { + return new StorageIdentity(content); + } + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Collections.IDictionary content that should be used. + internal StorageIdentity(global::System.Collections.IDictionary content) + { + bool returnNow = false; + BeforeDeserializeDictionary(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("DeletedAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).DeletedAccountName = (string) content.GetValueForProperty("DeletedAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).DeletedAccountName, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ManagementPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ManagementPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName?) content.GetValueForProperty("ManagementPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName.CreateFrom); + } + if (content.Contains("BlobInventoryPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobInventoryPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName?) content.GetValueForProperty("BlobInventoryPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobInventoryPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName.CreateFrom); + } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } + if (content.Contains("ObjectReplicationPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ObjectReplicationPolicyId = (string) content.GetValueForProperty("ObjectReplicationPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ObjectReplicationPolicyId, global::System.Convert.ToString); + } + if (content.Contains("Username")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Username, global::System.Convert.ToString); + } + if (content.Contains("EncryptionScopeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).EncryptionScopeName = (string) content.GetValueForProperty("EncryptionScopeName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).EncryptionScopeName, global::System.Convert.ToString); + } + if (content.Contains("BlobServicesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobServicesName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName?) content.GetValueForProperty("BlobServicesName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobServicesName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ImmutabilityPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName?) content.GetValueForProperty("ImmutabilityPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ImmutabilityPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName.CreateFrom); + } + if (content.Contains("FileServicesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).FileServicesName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName?) content.GetValueForProperty("FileServicesName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).FileServicesName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName.CreateFrom); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("QueueServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueServiceName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName?) content.GetValueForProperty("QueueServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueServiceName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName.CreateFrom); + } + if (content.Contains("QueueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueName = (string) content.GetValueForProperty("QueueName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueName, global::System.Convert.ToString); + } + if (content.Contains("TableServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableServiceName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName?) content.GetValueForProperty("TableServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableServiceName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName.CreateFrom); + } + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializeDictionary(content); + } + + /// + /// Deserializes a into a new instance of . + /// + /// The global::System.Management.Automation.PSObject content that should be used. + internal StorageIdentity(global::System.Management.Automation.PSObject content) + { + bool returnNow = false; + BeforeDeserializePSObject(content, ref returnNow); + if (returnNow) + { + return; + } + // actually deserialize + if (content.Contains("SubscriptionId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).SubscriptionId = (string) content.GetValueForProperty("SubscriptionId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).SubscriptionId, global::System.Convert.ToString); + } + if (content.Contains("ResourceGroupName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ResourceGroupName = (string) content.GetValueForProperty("ResourceGroupName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ResourceGroupName, global::System.Convert.ToString); + } + if (content.Contains("AccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).AccountName = (string) content.GetValueForProperty("AccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).AccountName, global::System.Convert.ToString); + } + if (content.Contains("DeletedAccountName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).DeletedAccountName = (string) content.GetValueForProperty("DeletedAccountName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).DeletedAccountName, global::System.Convert.ToString); + } + if (content.Contains("Location")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Location = (string) content.GetValueForProperty("Location",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Location, global::System.Convert.ToString); + } + if (content.Contains("ManagementPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ManagementPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName?) content.GetValueForProperty("ManagementPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ManagementPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName.CreateFrom); + } + if (content.Contains("BlobInventoryPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobInventoryPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName?) content.GetValueForProperty("BlobInventoryPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobInventoryPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName.CreateFrom); + } + if (content.Contains("PrivateEndpointConnectionName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).PrivateEndpointConnectionName = (string) content.GetValueForProperty("PrivateEndpointConnectionName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).PrivateEndpointConnectionName, global::System.Convert.ToString); + } + if (content.Contains("ObjectReplicationPolicyId")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ObjectReplicationPolicyId = (string) content.GetValueForProperty("ObjectReplicationPolicyId",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ObjectReplicationPolicyId, global::System.Convert.ToString); + } + if (content.Contains("Username")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Username = (string) content.GetValueForProperty("Username",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Username, global::System.Convert.ToString); + } + if (content.Contains("EncryptionScopeName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).EncryptionScopeName = (string) content.GetValueForProperty("EncryptionScopeName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).EncryptionScopeName, global::System.Convert.ToString); + } + if (content.Contains("BlobServicesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobServicesName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName?) content.GetValueForProperty("BlobServicesName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).BlobServicesName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName.CreateFrom); + } + if (content.Contains("ContainerName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ContainerName = (string) content.GetValueForProperty("ContainerName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ContainerName, global::System.Convert.ToString); + } + if (content.Contains("ImmutabilityPolicyName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ImmutabilityPolicyName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName?) content.GetValueForProperty("ImmutabilityPolicyName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ImmutabilityPolicyName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName.CreateFrom); + } + if (content.Contains("FileServicesName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).FileServicesName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName?) content.GetValueForProperty("FileServicesName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).FileServicesName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName.CreateFrom); + } + if (content.Contains("ShareName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ShareName = (string) content.GetValueForProperty("ShareName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).ShareName, global::System.Convert.ToString); + } + if (content.Contains("QueueServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueServiceName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName?) content.GetValueForProperty("QueueServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueServiceName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName.CreateFrom); + } + if (content.Contains("QueueName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueName = (string) content.GetValueForProperty("QueueName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).QueueName, global::System.Convert.ToString); + } + if (content.Contains("TableServiceName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableServiceName = (Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName?) content.GetValueForProperty("TableServiceName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableServiceName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName.CreateFrom); + } + if (content.Contains("TableName")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableName = (string) content.GetValueForProperty("TableName",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).TableName, global::System.Convert.ToString); + } + if (content.Contains("Id")) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Id = (string) content.GetValueForProperty("Id",((Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal)this).Id, global::System.Convert.ToString); + } + AfterDeserializePSObject(content); + } + + /// Serializes this instance to a json string. + + /// a containing this model serialized to JSON text. + public string ToJsonString() => ToJson(null, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode.IncludeAll)?.ToString(); + } + [System.ComponentModel.TypeConverter(typeof(StorageIdentityTypeConverter))] + public partial interface IStorageIdentity + + { + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/StorageIdentity.TypeConverter.cs b/swaggerci/storage/generated/api/Models/StorageIdentity.TypeConverter.cs new file mode 100644 index 000000000000..1bdefb37a960 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/StorageIdentity.TypeConverter.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell; + + /// + /// A PowerShell PSTypeConverter to support converting to an instance of + /// + public partial class StorageIdentityTypeConverter : global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to the + /// type. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + // we allow string conversion too. + if (type == typeof(global::System.String)) + { + return true; + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the + /// parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + // support direct string to id type conversion. + if (type == typeof(global::System.String)) + { + return new StorageIdentity { Id = sourceValue }; + } + if (typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return StorageIdentity.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString());; + } + catch + { + // Unable to use JSON pattern + } + if (typeof(global::System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return StorageIdentity.DeserializeFromPSObject(sourceValue); + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return StorageIdentity.DeserializeFromDictionary(sourceValue); + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/StorageIdentity.cs b/swaggerci/storage/generated/api/Models/StorageIdentity.cs new file mode 100644 index 000000000000..b9ecaa7c3c64 --- /dev/null +++ b/swaggerci/storage/generated/api/Models/StorageIdentity.cs @@ -0,0 +1,526 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentityInternal + { + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName? _blobInventoryPolicyName; + + /// + /// The name of the storage account blob inventory policy. It should always be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName? BlobInventoryPolicyName { get => this._blobInventoryPolicyName; set => this._blobInventoryPolicyName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName? _blobServicesName; + + /// + /// The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName? BlobServicesName { get => this._blobServicesName; set => this._blobServicesName = value; } + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Backing field for property. + private string _deletedAccountName; + + /// Name of the deleted storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string DeletedAccountName { get => this._deletedAccountName; set => this._deletedAccountName = value; } + + /// Backing field for property. + private string _encryptionScopeName; + + /// + /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 + /// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately + /// preceded and followed by a letter or number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string EncryptionScopeName { get => this._encryptionScopeName; set => this._encryptionScopeName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName? _fileServicesName; + + /// + /// The name of the file Service within the specified storage account. File Service Name must be "default" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName? FileServicesName { get => this._fileServicesName; set => this._fileServicesName = value; } + + /// Backing field for property. + private string _id; + + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Id { get => this._id; set => this._id = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName? _immutabilityPolicyName; + + /// + /// The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be + /// 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName? ImmutabilityPolicyName { get => this._immutabilityPolicyName; set => this._immutabilityPolicyName = value; } + + /// Backing field for property. + private string _location; + + /// The location of the deleted storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Location { get => this._location; set => this._location = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName? _managementPolicyName; + + /// + /// The name of the Storage Account Management Policy. It should always be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName? ManagementPolicyName { get => this._managementPolicyName; set => this._managementPolicyName = value; } + + /// Backing field for property. + private string _objectReplicationPolicyId; + + /// + /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the + /// source account, provide the value of the policy ID that is returned when you download the policy that was defined on the + /// destination account. The policy is downloaded as a JSON file. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ObjectReplicationPolicyId { get => this._objectReplicationPolicyId; set => this._objectReplicationPolicyId = value; } + + /// Backing field for property. + private string _privateEndpointConnectionName; + + /// The name of the private endpoint connection associated with the Azure resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string PrivateEndpointConnectionName { get => this._privateEndpointConnectionName; set => this._privateEndpointConnectionName = value; } + + /// Backing field for property. + private string _queueName; + + /// + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot + /// have two consecutive dash(-) characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string QueueName { get => this._queueName; set => this._queueName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName? _queueServiceName; + + /// + /// The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName? QueueServiceName { get => this._queueServiceName; set => this._queueServiceName = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _tableName; + + /// + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// only alphanumeric characters and it cannot begin with a numeric character. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string TableName { get => this._tableName; set => this._tableName = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName? _tableServiceName; + + /// + /// The name of the Table Service within the specified storage account. Table Service Name must be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName? TableServiceName { get => this._tableServiceName; set => this._tableServiceName = value; } + + /// Backing field for property. + private string _username; + + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Origin(Microsoft.Azure.PowerShell.Cmdlets.Storage.PropertyOrigin.Owned)] + public string Username { get => this._username; set => this._username = value; } + + /// Creates an new instance. + public StorageIdentity() + { + + } + } + public partial interface IStorageIdentity : + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable + { + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + string AccountName { get; set; } + /// + /// The name of the storage account blob inventory policy. It should always be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the storage account blob inventory policy. It should always be 'default'", + SerializedName = @"blobInventoryPolicyName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName? BlobInventoryPolicyName { get; set; } + /// + /// The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the blob Service within the specified storage account. Blob Service Name must be 'default'", + SerializedName = @"BlobServicesName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName? BlobServicesName { get; set; } + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + string ContainerName { get; set; } + /// Name of the deleted storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Name of the deleted storage account.", + SerializedName = @"deletedAccountName", + PossibleTypes = new [] { typeof(string) })] + string DeletedAccountName { get; set; } + /// + /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 + /// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately + /// preceded and followed by a letter or number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"encryptionScopeName", + PossibleTypes = new [] { typeof(string) })] + string EncryptionScopeName { get; set; } + /// + /// The name of the file Service within the specified storage account. File Service Name must be "default" + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the file Service within the specified storage account. File Service Name must be ""default""", + SerializedName = @"FileServicesName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName? FileServicesName { get; set; } + /// Resource identity path + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Resource identity path", + SerializedName = @"id", + PossibleTypes = new [] { typeof(string) })] + string Id { get; set; } + /// + /// The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be + /// 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be 'default'", + SerializedName = @"immutabilityPolicyName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName? ImmutabilityPolicyName { get; set; } + /// The location of the deleted storage account. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The location of the deleted storage account.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + string Location { get; set; } + /// + /// The name of the Storage Account Management Policy. It should always be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Storage Account Management Policy. It should always be 'default'", + SerializedName = @"managementPolicyName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName? ManagementPolicyName { get; set; } + /// + /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the + /// source account, provide the value of the policy ID that is returned when you download the policy that was defined on the + /// destination account. The policy is downloaded as a JSON file. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file.", + SerializedName = @"objectReplicationPolicyId", + PossibleTypes = new [] { typeof(string) })] + string ObjectReplicationPolicyId { get; set; } + /// The name of the private endpoint connection associated with the Azure resource + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + string PrivateEndpointConnectionName { get; set; } + /// + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot + /// have two consecutive dash(-) characters. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.", + SerializedName = @"queueName", + PossibleTypes = new [] { typeof(string) })] + string QueueName { get; set; } + /// + /// The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Queue Service within the specified storage account. Queue Service Name must be 'default'", + SerializedName = @"queueServiceName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName? QueueServiceName { get; set; } + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + string ResourceGroupName { get; set; } + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + string ShareName { get; set; } + /// The ID of the target subscription. + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + string SubscriptionId { get; set; } + /// + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// only alphanumeric characters and it cannot begin with a numeric character. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + string TableName { get; set; } + /// + /// The name of the Table Service within the specified storage account. Table Service Name must be 'default' + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the Table Service within the specified storage account. Table Service Name must be 'default'", + SerializedName = @"tableServiceName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName) })] + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName? TableServiceName { get; set; } + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + string Username { get; set; } + + } + internal partial interface IStorageIdentityInternal + + { + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + string AccountName { get; set; } + /// + /// The name of the storage account blob inventory policy. It should always be 'default' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName? BlobInventoryPolicyName { get; set; } + /// + /// The name of the blob Service within the specified storage account. Blob Service Name must be 'default' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName? BlobServicesName { get; set; } + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + string ContainerName { get; set; } + /// Name of the deleted storage account. + string DeletedAccountName { get; set; } + /// + /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 + /// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately + /// preceded and followed by a letter or number. + /// + string EncryptionScopeName { get; set; } + /// + /// The name of the file Service within the specified storage account. File Service Name must be "default" + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName? FileServicesName { get; set; } + /// Resource identity path + string Id { get; set; } + /// + /// The name of the blob container immutabilityPolicy within the specified storage account. ImmutabilityPolicy Name must be + /// 'default' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName? ImmutabilityPolicyName { get; set; } + /// The location of the deleted storage account. + string Location { get; set; } + /// + /// The name of the Storage Account Management Policy. It should always be 'default' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName? ManagementPolicyName { get; set; } + /// + /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the + /// source account, provide the value of the policy ID that is returned when you download the policy that was defined on the + /// destination account. The policy is downloaded as a JSON file. + /// + string ObjectReplicationPolicyId { get; set; } + /// The name of the private endpoint connection associated with the Azure resource + string PrivateEndpointConnectionName { get; set; } + /// + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot + /// have two consecutive dash(-) characters. + /// + string QueueName { get; set; } + /// + /// The name of the Queue Service within the specified storage account. Queue Service Name must be 'default' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName? QueueServiceName { get; set; } + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + string ResourceGroupName { get; set; } + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + string ShareName { get; set; } + /// The ID of the target subscription. + string SubscriptionId { get; set; } + /// + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// only alphanumeric characters and it cannot begin with a numeric character. + /// + string TableName { get; set; } + /// + /// The name of the Table Service within the specified storage account. Table Service Name must be 'default' + /// + Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName? TableServiceName { get; set; } + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + string Username { get; set; } + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Models/StorageIdentity.json.cs b/swaggerci/storage/generated/api/Models/StorageIdentity.json.cs new file mode 100644 index 000000000000..c36cdeeafc3c --- /dev/null +++ b/swaggerci/storage/generated/api/Models/StorageIdentity.json.cs @@ -0,0 +1,147 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Models +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public partial class StorageIdentity + { + + /// + /// AfterFromJson will be called after the json deserialization has finished, allowing customization of the object + /// before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JsonNode that should be deserialized into this object. + + partial void AfterFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json); + + /// + /// AfterToJson will be called after the json serialization has finished, allowing customization of the before it is returned. Implement this method in a partial class to enable this behavior + /// + /// The JSON container that the serialization result will be placed in. + + partial void AfterToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container); + + /// + /// BeforeFromJson will be called before the json deserialization has commenced, allowing complete customization of + /// the object before it is deserialized. + /// If you wish to disable the default deserialization entirely, return true in the + /// output parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JsonNode that should be deserialized into this object. + /// Determines if the rest of the deserialization should be processed, or if the method should return + /// instantly. + + partial void BeforeFromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json, ref bool returnNow); + + /// + /// BeforeToJson will be called before the json serialization has commenced, allowing complete customization of the + /// object before it is serialized. + /// If you wish to disable the default serialization entirely, return true in the output + /// parameter. + /// Implement this method in a partial class to enable this behavior. + /// + /// The JSON container that the serialization result will be placed in. + /// Determines if the rest of the serialization should be processed, or if the method should return + /// instantly. + + partial void BeforeToJson(ref Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, ref bool returnNow); + + /// + /// Deserializes a into an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity. + /// + /// a to deserialize from. + /// + /// an instance of Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity. + /// + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new StorageIdentity(json) : null; + } + + /// + /// Deserializes a Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject into a new instance of . + /// + /// A Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject instance to deserialize from. + internal StorageIdentity(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + bool returnNow = false; + BeforeFromJson(json, ref returnNow); + if (returnNow) + { + return; + } + {_subscriptionId = If( json?.PropertyT("subscriptionId"), out var __jsonSubscriptionId) ? (string)__jsonSubscriptionId : (string)SubscriptionId;} + {_resourceGroupName = If( json?.PropertyT("resourceGroupName"), out var __jsonResourceGroupName) ? (string)__jsonResourceGroupName : (string)ResourceGroupName;} + {_accountName = If( json?.PropertyT("accountName"), out var __jsonAccountName) ? (string)__jsonAccountName : (string)AccountName;} + {_deletedAccountName = If( json?.PropertyT("deletedAccountName"), out var __jsonDeletedAccountName) ? (string)__jsonDeletedAccountName : (string)DeletedAccountName;} + {_location = If( json?.PropertyT("location"), out var __jsonLocation) ? (string)__jsonLocation : (string)Location;} + {_managementPolicyName = If( json?.PropertyT("managementPolicyName"), out var __jsonManagementPolicyName) ? (string)__jsonManagementPolicyName : (string)ManagementPolicyName;} + {_blobInventoryPolicyName = If( json?.PropertyT("blobInventoryPolicyName"), out var __jsonBlobInventoryPolicyName) ? (string)__jsonBlobInventoryPolicyName : (string)BlobInventoryPolicyName;} + {_privateEndpointConnectionName = If( json?.PropertyT("privateEndpointConnectionName"), out var __jsonPrivateEndpointConnectionName) ? (string)__jsonPrivateEndpointConnectionName : (string)PrivateEndpointConnectionName;} + {_objectReplicationPolicyId = If( json?.PropertyT("objectReplicationPolicyId"), out var __jsonObjectReplicationPolicyId) ? (string)__jsonObjectReplicationPolicyId : (string)ObjectReplicationPolicyId;} + {_username = If( json?.PropertyT("username"), out var __jsonUsername) ? (string)__jsonUsername : (string)Username;} + {_encryptionScopeName = If( json?.PropertyT("encryptionScopeName"), out var __jsonEncryptionScopeName) ? (string)__jsonEncryptionScopeName : (string)EncryptionScopeName;} + {_blobServicesName = If( json?.PropertyT("BlobServicesName"), out var __jsonBlobServicesName) ? (string)__jsonBlobServicesName : (string)BlobServicesName;} + {_containerName = If( json?.PropertyT("containerName"), out var __jsonContainerName) ? (string)__jsonContainerName : (string)ContainerName;} + {_immutabilityPolicyName = If( json?.PropertyT("immutabilityPolicyName"), out var __jsonImmutabilityPolicyName) ? (string)__jsonImmutabilityPolicyName : (string)ImmutabilityPolicyName;} + {_fileServicesName = If( json?.PropertyT("FileServicesName"), out var __jsonFileServicesName) ? (string)__jsonFileServicesName : (string)FileServicesName;} + {_shareName = If( json?.PropertyT("shareName"), out var __jsonShareName) ? (string)__jsonShareName : (string)ShareName;} + {_queueServiceName = If( json?.PropertyT("queueServiceName"), out var __jsonQueueServiceName) ? (string)__jsonQueueServiceName : (string)QueueServiceName;} + {_queueName = If( json?.PropertyT("queueName"), out var __jsonQueueName) ? (string)__jsonQueueName : (string)QueueName;} + {_tableServiceName = If( json?.PropertyT("tableServiceName"), out var __jsonTableServiceName) ? (string)__jsonTableServiceName : (string)TableServiceName;} + {_tableName = If( json?.PropertyT("tableName"), out var __jsonTableName) ? (string)__jsonTableName : (string)TableName;} + {_id = If( json?.PropertyT("id"), out var __jsonId) ? (string)__jsonId : (string)Id;} + AfterFromJson(json); + } + + /// + /// Serializes this instance of into a . + /// + /// The container to serialize this object into. If the caller + /// passes in null, a new instance will be created and returned to the caller. + /// Allows the caller to choose the depth of the serialization. See . + /// + /// a serialized instance of as a . + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode ToJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject container, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SerializationMode serializationMode) + { + container = container ?? new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject(); + + bool returnNow = false; + BeforeToJson(ref container, ref returnNow); + if (returnNow) + { + return container; + } + AddIf( null != (((object)this._subscriptionId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._subscriptionId.ToString()) : null, "subscriptionId" ,container.Add ); + AddIf( null != (((object)this._resourceGroupName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._resourceGroupName.ToString()) : null, "resourceGroupName" ,container.Add ); + AddIf( null != (((object)this._accountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._accountName.ToString()) : null, "accountName" ,container.Add ); + AddIf( null != (((object)this._deletedAccountName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._deletedAccountName.ToString()) : null, "deletedAccountName" ,container.Add ); + AddIf( null != (((object)this._location)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._location.ToString()) : null, "location" ,container.Add ); + AddIf( null != (((object)this._managementPolicyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._managementPolicyName.ToString()) : null, "managementPolicyName" ,container.Add ); + AddIf( null != (((object)this._blobInventoryPolicyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._blobInventoryPolicyName.ToString()) : null, "blobInventoryPolicyName" ,container.Add ); + AddIf( null != (((object)this._privateEndpointConnectionName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._privateEndpointConnectionName.ToString()) : null, "privateEndpointConnectionName" ,container.Add ); + AddIf( null != (((object)this._objectReplicationPolicyId)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._objectReplicationPolicyId.ToString()) : null, "objectReplicationPolicyId" ,container.Add ); + AddIf( null != (((object)this._username)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._username.ToString()) : null, "username" ,container.Add ); + AddIf( null != (((object)this._encryptionScopeName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._encryptionScopeName.ToString()) : null, "encryptionScopeName" ,container.Add ); + AddIf( null != (((object)this._blobServicesName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._blobServicesName.ToString()) : null, "BlobServicesName" ,container.Add ); + AddIf( null != (((object)this._containerName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._containerName.ToString()) : null, "containerName" ,container.Add ); + AddIf( null != (((object)this._immutabilityPolicyName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._immutabilityPolicyName.ToString()) : null, "immutabilityPolicyName" ,container.Add ); + AddIf( null != (((object)this._fileServicesName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._fileServicesName.ToString()) : null, "FileServicesName" ,container.Add ); + AddIf( null != (((object)this._shareName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._shareName.ToString()) : null, "shareName" ,container.Add ); + AddIf( null != (((object)this._queueServiceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._queueServiceName.ToString()) : null, "queueServiceName" ,container.Add ); + AddIf( null != (((object)this._queueName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._queueName.ToString()) : null, "queueName" ,container.Add ); + AddIf( null != (((object)this._tableServiceName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tableServiceName.ToString()) : null, "tableServiceName" ,container.Add ); + AddIf( null != (((object)this._tableName)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._tableName.ToString()) : null, "tableName" ,container.Add ); + AddIf( null != (((object)this._id)?.ToString()) ? (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode) new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonString(this._id.ToString()) : null, "id" ,container.Add ); + AfterToJson(ref container); + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/StorageManagementClient.cs b/swaggerci/storage/generated/api/StorageManagementClient.cs new file mode 100644 index 000000000000..d958bcf14002 --- /dev/null +++ b/swaggerci/storage/generated/api/StorageManagementClient.cs @@ -0,0 +1,17604 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + /// + /// Low-level API implementation for the StorageManagementClient service. + /// The Azure Storage Management API. + /// + public partial class StorageManagementClient + { + + /// + /// Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears + /// out only the specified tags in the request. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The LegalHold property that will be clear from a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersClearLegalHold(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/clearLegalHold" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersClearLegalHold_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears + /// out only the specified tags in the request. + /// + /// + /// The LegalHold property that will be clear from a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersClearLegalHoldViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/clearLegalHold$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/clearLegalHold" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersClearLegalHold_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersClearLegalHold_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHold.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The LegalHold property that will be clear from a blob container. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersClearLegalHold_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates a new container under the specified account as described by request body. The container resource includes metadata + /// and properties for that container. It does not include a list of the blobs contained by the container. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Properties of the blob container to create. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersCreate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersCreate_Call(request,onOk,onCreated,eventListener,sender); + } + } + + /// + /// Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// The ImmutabilityPolicy Properties that will be created or updated to a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersCreateOrUpdateImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var immutabilityPolicyName = @"default"; + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/immutabilityPolicies/" + + global::System.Uri.EscapeDataString(immutabilityPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersCreateOrUpdateImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + /// + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// The ImmutabilityPolicy Properties that will be created or updated to a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersCreateOrUpdateImmutabilityPolicyViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/immutabilityPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var immutabilityPolicyName = _match.Groups["immutabilityPolicyName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/immutabilityPolicies/" + + immutabilityPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersCreateOrUpdateImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersCreateOrUpdateImmutabilityPolicy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// The ImmutabilityPolicy Properties that will be created or updated to a blob container. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersCreateOrUpdateImmutabilityPolicy_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates a new container under the specified account as described by request body. The container resource includes metadata + /// and properties for that container. It does not include a list of the blobs contained by the container. + /// + /// + /// Properties of the blob container to create. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersCreate_Call(request,onOk,onCreated,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Properties of the blob container to create. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersCreate_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specified container under its account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersDelete(string resourceGroupName, string accountName, string containerName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersDelete_Call(request,onOk,onNoContent,eventListener,sender); + } + } + + /// + /// Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag + /// in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete + /// the container after deleting all expired blobs inside the policy locked container. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersDeleteImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var immutabilityPolicyName = @"default"; + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/immutabilityPolicies/" + + global::System.Uri.EscapeDataString(immutabilityPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersDeleteImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag + /// in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete + /// the container after deleting all expired blobs inside the policy locked container. + /// + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersDeleteImmutabilityPolicyViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/immutabilityPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var immutabilityPolicyName = _match.Groups["immutabilityPolicyName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/immutabilityPolicies/" + + immutabilityPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersDeleteImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersDeleteImmutabilityPolicy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersDeleteImmutabilityPolicy_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// Deletes specified container under its account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersDelete_Call(request,onOk,onNoContent,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersDelete_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked + /// policy will be this action. ETag in If-Match is required for this operation. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// The ImmutabilityPolicy Properties that will be extended for a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersExtendImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/immutabilityPolicies/default/extend" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersExtendImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked + /// policy will be this action. ETag in If-Match is required for this operation. + /// + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// The ImmutabilityPolicy Properties that will be extended for a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersExtendImmutabilityPolicyViaIdentity(global::System.String viaIdentity, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/immutabilityPolicies/default/extend$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/immutabilityPolicies/default/extend" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersExtendImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersExtendImmutabilityPolicy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// The ImmutabilityPolicy Properties that will be extended for a blob container. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersExtendImmutabilityPolicy_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets properties of a specified container. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersGet(string resourceGroupName, string accountName, string containerName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersGet_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Gets the existing immutability policy along with the corresponding ETag in response headers and body. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersGetImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var immutabilityPolicyName = @"default"; + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/immutabilityPolicies/" + + global::System.Uri.EscapeDataString(immutabilityPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersGetImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Gets the existing immutability policy along with the corresponding ETag in response headers and body. + /// + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersGetImmutabilityPolicyViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/immutabilityPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var immutabilityPolicyName = _match.Groups["immutabilityPolicyName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/immutabilityPolicies/" + + immutabilityPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != ifMatch) + { + request.Headers.Add("If-Match",ifMatch); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersGetImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersGetImmutabilityPolicy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersGetImmutabilityPolicy_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// Gets properties of a specified container. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersGet_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can + /// be 15 to 60 seconds, or can be infinite. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Lease Container request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersLease(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/lease" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersLease_Call(request,onOk,eventListener,sender); + } + } + + /// + /// The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can + /// be 15 to 60 seconds, or can be infinite. + /// + /// + /// Lease Container request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersLeaseViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/lease$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/lease" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersLease_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersLease_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseContainerResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Lease Container request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersLease_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Optional. Specified maximum number of containers that can be included in the list. + /// Optional. When specified, only container names starting with the filter will be listed. + /// Optional, used to include the properties for soft deleted blob containers. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersList(string resourceGroupName, string accountName, string subscriptionId, string Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude? Include, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Include) ? global::System.String.Empty : "$include=" + global::System.Uri.EscapeDataString(Include)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersList_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + /// + /// + /// Optional. Specified maximum number of containers that can be included in the list. + /// Optional. When specified, only container names starting with the filter will be listed. + /// Optional, used to include the properties for soft deleted blob containers. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersListViaIdentity(global::System.String viaIdentity, string Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude? Include, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Include) ? global::System.String.Empty : "$include=" + global::System.Uri.EscapeDataString(Include)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListContainerItems.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Optional. Specified maximum number of containers that can be included in the list. + /// Optional. When specified, only container names starting with the filter will be listed. + /// Optional, used to include the properties for soft deleted blob containers. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersList_Validate(string resourceGroupName, string accountName, string subscriptionId, string Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude? Include, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(Maxpagesize),Maxpagesize); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Include),Include); + await eventListener.AssertEnum(nameof(Include),Include,@"deleted"); + } + } + + /// + /// Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. + /// ETag in If-Match is required for this operation. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersLockImmutabilityPolicy(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/immutabilityPolicies/default/lock" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersLockImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. + /// ETag in If-Match is required for this operation. + /// + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersLockImmutabilityPolicyViaIdentity(global::System.String viaIdentity, string ifMatch, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/immutabilityPolicies/default/lock$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/immutabilityPolicies/default/lock" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + request.Headers.Add("If-Match",ifMatch.ToString()); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersLockImmutabilityPolicy_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersLockImmutabilityPolicy_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used + /// to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersLockImmutabilityPolicy_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, string ifMatch, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(ifMatch),ifMatch); + } + } + + /// + /// This operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites + /// require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled + /// and there should be no Legal hold on the container. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersObjectLevelWorm(string resourceGroupName, string accountName, string containerName, string subscriptionId, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/migrate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersObjectLevelWorm_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// This operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites + /// require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled + /// and there should be no Legal hold on the container. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersObjectLevelWormViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/migrate$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/migrate" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersObjectLevelWorm_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersObjectLevelWorm_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersObjectLevelWorm_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern + /// and does not clear out the existing tags that are not specified in the request. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The LegalHold property that will be set to a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersSetLegalHold(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "/setLegalHold" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersSetLegalHold_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern + /// and does not clear out the existing tags that are not specified in the request. + /// + /// + /// The LegalHold property that will be set to a blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersSetLegalHoldViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)/setLegalHold$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/setLegalHold'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "/setLegalHold" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersSetLegalHold_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersSetLegalHold_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHold.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The LegalHold property that will be set to a blob container. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersSetLegalHold_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. + /// Update fails if the specified container doesn't already exist. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Properties to update for the blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersUpdate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/default/containers/" + + global::System.Uri.EscapeDataString(containerName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. + /// Update fails if the specified container doesn't already exist. + /// + /// + /// Properties to update for the blob container. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobContainersUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/default/containers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var containerName = _match.Groups["containerName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/default/containers/" + + containerName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobContainersUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the blob container within the specified storage account. Blob container names + /// must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character + /// must be immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Properties to update for the blob container. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobContainersUpdate_Validate(string resourceGroupName, string accountName, string containerName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(containerName),containerName); + await eventListener.AssertMinimumLength(nameof(containerName),containerName,3); + await eventListener.AssertMaximumLength(nameof(containerName),containerName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Sets the blob inventory policy to the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The blob inventory policy set to a storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesCreateOrUpdate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var blobInventoryPolicyName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/inventoryPolicies/" + + global::System.Uri.EscapeDataString(blobInventoryPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Sets the blob inventory policy to the specified storage account. + /// + /// The blob inventory policy set to a storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/inventoryPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var blobInventoryPolicyName = _match.Groups["blobInventoryPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/inventoryPolicies/" + + blobInventoryPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The blob inventory policy set to a storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesCreateOrUpdate_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes the blob inventory policy associated with the specified storage account. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesDelete(string resourceGroupName, string accountName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var blobInventoryPolicyName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/inventoryPolicies/" + + global::System.Uri.EscapeDataString(blobInventoryPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes the blob inventory policy associated with the specified storage account. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/inventoryPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var blobInventoryPolicyName = _match.Groups["blobInventoryPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/inventoryPolicies/" + + blobInventoryPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Gets the blob inventory policy associated with the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesGet(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var blobInventoryPolicyName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/inventoryPolicies/" + + global::System.Uri.EscapeDataString(blobInventoryPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the blob inventory policy associated with the specified storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/inventoryPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var blobInventoryPolicyName = _match.Groups["blobInventoryPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/inventoryPolicies/" + + blobInventoryPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesGet_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Gets the blob inventory policy associated with the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/inventoryPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets the blob inventory policy associated with the specified storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobInventoryPoliciesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/inventoryPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/inventoryPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobInventoryPoliciesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListBlobInventoryPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobInventoryPoliciesList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobServicesGetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var blobServicesName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/" + + global::System.Uri.EscapeDataString(blobServicesName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobServicesGetServiceProperties_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobServicesGetServicePropertiesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var blobServicesName = _match.Groups["BlobServicesName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/" + + blobServicesName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobServicesGetServiceProperties_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobServicesGetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobServicesGetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// List blob services of storage account. It returns a collection of one object named default. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobServicesList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobServicesList_Call(request,onOk,eventListener,sender); + } + } + + /// + /// List blob services of storage account. It returns a collection of one object named default. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobServicesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobServicesList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobServicesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServiceItems.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobServicesList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of a storage account’s Blob service, including properties for Storage Analytics and + /// CORS (Cross-Origin Resource Sharing) rules. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobServicesSetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var blobServicesName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/blobServices/" + + global::System.Uri.EscapeDataString(blobServicesName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobServicesSetServiceProperties_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Sets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// The properties of a storage account’s Blob service, including properties for Storage Analytics and + /// CORS (Cross-Origin Resource Sharing) rules. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task BlobServicesSetServicePropertiesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/blobServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var blobServicesName = _match.Groups["BlobServicesName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/blobServices/" + + blobServicesName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.BlobServicesSetServiceProperties_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobServicesSetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of a storage account’s Blob service, including properties for Storage Analytics and + /// CORS (Cross-Origin Resource Sharing) rules. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task BlobServicesSetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Get properties of specified deleted account resource. + /// Name of the deleted storage account. + /// The location of the deleted storage account. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedAccountsGet(string deletedAccountName, string location, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Storage/locations/" + + global::System.Uri.EscapeDataString(location) + + "/deletedAccounts/" + + global::System.Uri.EscapeDataString(deletedAccountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedAccountsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get properties of specified deleted account resource. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedAccountsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Storage/locations/(?[^/]+)/deletedAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}'"); + } + + // replace URI parameters with values from identity + var deletedAccountName = _match.Groups["deletedAccountName"].Value; + var location = _match.Groups["location"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Storage/locations/" + + location + + "/deletedAccounts/" + + deletedAccountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedAccountsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedAccountsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccount.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// Name of the deleted storage account. + /// The location of the deleted storage account. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedAccountsGet_Validate(string deletedAccountName, string location, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(deletedAccountName),deletedAccountName); + await eventListener.AssertMinimumLength(nameof(deletedAccountName),deletedAccountName,3); + await eventListener.AssertMaximumLength(nameof(deletedAccountName),deletedAccountName,24); + await eventListener.AssertNotNull(nameof(location),location); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Lists deleted accounts under the subscription. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedAccountsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Storage/deletedAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedAccountsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists deleted accounts under the subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task DeletedAccountsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Storage/deletedAccounts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Storage/deletedAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.DeletedAccountsList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedAccountsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedAccountListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task DeletedAccountsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Returns the properties for the specified encryption scope. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the encryption scope within the specified storage account. Encryption scope + /// names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + /// (-) character must be immediately preceded and followed by a letter or number. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesGet(string resourceGroupName, string accountName, string subscriptionId, string encryptionScopeName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/encryptionScopes/" + + global::System.Uri.EscapeDataString(encryptionScopeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Returns the properties for the specified encryption scope. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/encryptionScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var encryptionScopeName = _match.Groups["encryptionScopeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/encryptionScopes/" + + encryptionScopeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the encryption scope within the specified storage account. Encryption scope + /// names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + /// (-) character must be immediately preceded and followed by a letter or number. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesGet_Validate(string resourceGroupName, string accountName, string subscriptionId, string encryptionScopeName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(encryptionScopeName),encryptionScopeName); + await eventListener.AssertMinimumLength(nameof(encryptionScopeName),encryptionScopeName,3); + await eventListener.AssertMaximumLength(nameof(encryptionScopeName),encryptionScopeName,63); + } + } + + /// Lists all the encryption scopes available under the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/encryptionScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesList_Call(request,onOk,eventListener,sender); + } + } + + /// Lists all the encryption scopes available under the specified storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/encryptionScopes$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/encryptionScopes" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScopeListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does + /// not already exist. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the encryption scope within the specified storage account. Encryption scope + /// names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + /// (-) character must be immediately preceded and followed by a letter or number. + /// Encryption scope properties to be used for the update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesPatch(string resourceGroupName, string accountName, string subscriptionId, string encryptionScopeName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/encryptionScopes/" + + global::System.Uri.EscapeDataString(encryptionScopeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesPatch_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does + /// not already exist. + /// + /// + /// Encryption scope properties to be used for the update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesPatchViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/encryptionScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var encryptionScopeName = _match.Groups["encryptionScopeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/encryptionScopes/" + + encryptionScopeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesPatch_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesPatch_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the encryption scope within the specified storage account. Encryption scope + /// names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + /// (-) character must be immediately preceded and followed by a letter or number. + /// Encryption scope properties to be used for the update. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesPatch_Validate(string resourceGroupName, string accountName, string subscriptionId, string encryptionScopeName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(encryptionScopeName),encryptionScopeName); + await eventListener.AssertMinimumLength(nameof(encryptionScopeName),encryptionScopeName,3); + await eventListener.AssertMaximumLength(nameof(encryptionScopeName),encryptionScopeName,63); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already + /// created and a subsequent request is issued with different properties, the encryption scope properties will be updated + /// per the specified request. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the encryption scope within the specified storage account. Encryption scope + /// names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + /// (-) character must be immediately preceded and followed by a letter or number. + /// Encryption scope properties to be used for the create or update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesPut(string resourceGroupName, string accountName, string subscriptionId, string encryptionScopeName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/encryptionScopes/" + + global::System.Uri.EscapeDataString(encryptionScopeName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesPut_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Synchronously creates or updates an encryption scope under the specified storage account. If an encryption scope is already + /// created and a subsequent request is issued with different properties, the encryption scope properties will be updated + /// per the specified request. + /// + /// + /// Encryption scope properties to be used for the create or update. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task EncryptionScopesPutViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/encryptionScopes/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var encryptionScopeName = _match.Groups["encryptionScopeName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/encryptionScopes/" + + encryptionScopeName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.EncryptionScopesPut_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesPut_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the encryption scope within the specified storage account. Encryption scope + /// names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash + /// (-) character must be immediately preceded and followed by a letter or number. + /// Encryption scope properties to be used for the create or update. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task EncryptionScopesPut_Validate(string resourceGroupName, string accountName, string subscriptionId, string encryptionScopeName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(encryptionScopeName),encryptionScopeName); + await eventListener.AssertMinimumLength(nameof(encryptionScopeName),encryptionScopeName,3); + await eventListener.AssertMaximumLength(nameof(encryptionScopeName),encryptionScopeName,63); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServicesGetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var fileServicesName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/" + + global::System.Uri.EscapeDataString(fileServicesName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServicesGetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServicesGetServicePropertiesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fileServicesName = _match.Groups["FileServicesName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/" + + fileServicesName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServicesGetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServicesGetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServicesGetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// List all file services in storage accounts + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServicesList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all file services in storage accounts + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServicesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServicesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServiceItems.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServicesList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + /// rules. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServicesSetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var fileServicesName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/" + + global::System.Uri.EscapeDataString(fileServicesName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServicesSetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Sets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + /// + /// + /// The properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + /// rules. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileServicesSetServicePropertiesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var fileServicesName = _match.Groups["FileServicesName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/" + + fileServicesName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileServicesSetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServicesSetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) + /// rules. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileServicesSetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Creates a new share under the specified account as described by request body. The share resource includes metadata and + /// properties for that share. It does not include a list of the files contained by the share. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should + /// be passed as a string with delimiter ',' + /// The ID of the target subscription. + /// Properties of the file share to create. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesCreate(string resourceGroupName, string accountName, string shareName, string Expand, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/default/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "?" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// + /// Creates a new share under the specified account as described by request body. The share resource includes metadata and + /// properties for that share. It does not include a list of the files contained by the share. + /// + /// + /// Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should + /// be passed as a string with delimiter ',' + /// Properties of the file share to create. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesCreateViaIdentity(global::System.String viaIdentity, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/default/shares/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/default/shares/" + + shareName + + "?" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + + "&" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesCreate_Call(request,onOk,onCreated,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 201 (Created). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onCreated, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + case global::System.Net.HttpStatusCode.Created: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onCreated(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should + /// be passed as a string with delimiter ',' + /// The ID of the target subscription. + /// Properties of the file share to create. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesCreate_Validate(string resourceGroupName, string accountName, string shareName, string Expand, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertMinimumLength(nameof(shareName),shareName,3); + await eventListener.AssertMaximumLength(nameof(shareName),shareName,63); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes specified share under its account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Optional, used to delete a snapshot. + /// Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + /// 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, + /// the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). + /// For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or + /// unleased), the deletion fails. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesDelete(string resourceGroupName, string accountName, string shareName, string subscriptionId, string xMSSnapshot, string Include, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/default/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Include) ? global::System.String.Empty : "$include=" + global::System.Uri.EscapeDataString(Include)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSSnapshot) + { + request.Headers.Add("x-ms-snapshot",xMSSnapshot); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes specified share under its account. + /// + /// Optional, used to delete a snapshot. + /// Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + /// 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, + /// the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). + /// For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or + /// unleased), the deletion fails. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesDeleteViaIdentity(global::System.String viaIdentity, string xMSSnapshot, string Include, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/default/shares/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/default/shares/" + + shareName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Include) ? global::System.String.Empty : "$include=" + global::System.Uri.EscapeDataString(Include)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSSnapshot) + { + request.Headers.Add("x-ms-snapshot",xMSSnapshot); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Optional, used to delete a snapshot. + /// Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For + /// 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, + /// the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). + /// For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or + /// unleased), the deletion fails. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesDelete_Validate(string resourceGroupName, string accountName, string shareName, string subscriptionId, string xMSSnapshot, string Include, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertMinimumLength(nameof(shareName),shareName,3); + await eventListener.AssertMaximumLength(nameof(shareName),shareName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(xMSSnapshot),xMSSnapshot); + await eventListener.AssertNotNull(nameof(Include),Include); + } + } + + /// Gets properties of a specified share. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Optional, used to expand the properties within share's properties. Valid values are: stats. Should + /// be passed as a string with delimiter ','. + /// Optional, used to retrieve properties of a snapshot. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesGet(string resourceGroupName, string accountName, string shareName, string subscriptionId, string Expand, string xMSSnapshot, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/default/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSSnapshot) + { + request.Headers.Add("x-ms-snapshot",xMSSnapshot); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets properties of a specified share. + /// + /// Optional, used to expand the properties within share's properties. Valid values are: stats. Should + /// be passed as a string with delimiter ','. + /// Optional, used to retrieve properties of a snapshot. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesGetViaIdentity(global::System.String viaIdentity, string Expand, string xMSSnapshot, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/default/shares/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/default/shares/" + + shareName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSSnapshot) + { + request.Headers.Add("x-ms-snapshot",xMSSnapshot); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Optional, used to expand the properties within share's properties. Valid values are: stats. Should + /// be passed as a string with delimiter ','. + /// Optional, used to retrieve properties of a snapshot. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesGet_Validate(string resourceGroupName, string accountName, string shareName, string subscriptionId, string Expand, string xMSSnapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertMinimumLength(nameof(shareName),shareName,3); + await eventListener.AssertMaximumLength(nameof(shareName),shareName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertNotNull(nameof(xMSSnapshot),xMSSnapshot); + } + } + + /// + /// The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 + /// to 60 seconds, or can be infinite. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Optional. Specify the snapshot time to lease a snapshot. + /// Lease Share request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesLease(string resourceGroupName, string accountName, string shareName, string subscriptionId, string xMSSnapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/default/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "/lease" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSSnapshot) + { + request.Headers.Add("x-ms-snapshot",xMSSnapshot); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesLease_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 + /// to 60 seconds, or can be infinite. + /// + /// + /// Optional. Specify the snapshot time to lease a snapshot. + /// Lease Share request body. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesLeaseViaIdentity(global::System.String viaIdentity, string xMSSnapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/default/shares/(?[^/]+)/lease$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/default/shares/" + + shareName + + "/lease" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // add headers parameters + if (null != xMSSnapshot) + { + request.Headers.Add("x-ms-snapshot",xMSSnapshot); + } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesLease_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesLease_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseShareResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) .ReadHeaders(_response.Headers))); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Optional. Specify the snapshot time to lease a snapshot. + /// Lease Share request body. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesLease_Validate(string resourceGroupName, string accountName, string shareName, string subscriptionId, string xMSSnapshot, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertMinimumLength(nameof(shareName),shareName,3); + await eventListener.AssertMaximumLength(nameof(shareName),shareName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(xMSSnapshot),xMSSnapshot); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists all shares. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Optional. Specified maximum number of shares that can be included in the list. + /// Optional. When specified, only share names starting with the filter will be listed. + /// Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. + /// Should be passed as a string with delimiter ',' + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesList(string resourceGroupName, string accountName, string subscriptionId, string Maxpagesize, string Filter, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/default/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Lists all shares. + /// + /// Optional. Specified maximum number of shares that can be included in the list. + /// Optional. When specified, only share names starting with the filter will be listed. + /// Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. + /// Should be passed as a string with delimiter ',' + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesListViaIdentity(global::System.String viaIdentity, string Maxpagesize, string Filter, string Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/default/shares$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/default/shares" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShareItems.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Optional. Specified maximum number of shares that can be included in the list. + /// Optional. When specified, only share names starting with the filter will be listed. + /// Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. + /// Should be passed as a string with delimiter ',' + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesList_Validate(string resourceGroupName, string accountName, string subscriptionId, string Maxpagesize, string Filter, string Expand, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(Maxpagesize),Maxpagesize); + await eventListener.AssertNotNull(nameof(Filter),Filter); + await eventListener.AssertNotNull(nameof(Expand),Expand); + } + } + + /// + /// Restore a file share within a valid retention days if share soft delete is enabled + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The deleted share to be restored. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesRestore(string resourceGroupName, string accountName, string shareName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/default/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "/restore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesRestore_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Restore a file share within a valid retention days if share soft delete is enabled + /// + /// + /// The deleted share to be restored. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesRestoreViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare body, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/default/shares/(?[^/]+)/restore$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/default/shares/" + + shareName + + "/restore" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesRestore_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesRestore_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// The deleted share to be restored. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesRestore_Validate(string resourceGroupName, string accountName, string shareName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertMinimumLength(nameof(shareName),shareName,3); + await eventListener.AssertMaximumLength(nameof(shareName),shareName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update + /// fails if the specified share does not already exist. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Properties to update for the file share. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesUpdate(string resourceGroupName, string accountName, string shareName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/fileServices/default/shares/" + + global::System.Uri.EscapeDataString(shareName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update + /// fails if the specified share does not already exist. + /// + /// + /// Properties to update for the file share. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task FileSharesUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/fileServices/default/shares/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var shareName = _match.Groups["shareName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/fileServices/default/shares/" + + shareName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.FileSharesUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The name of the file share within the specified storage account. File share names must be between + /// 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be + /// immediately preceded and followed by a letter or number. + /// The ID of the target subscription. + /// Properties to update for the file share. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task FileSharesUpdate_Validate(string resourceGroupName, string accountName, string shareName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(shareName),shareName); + await eventListener.AssertMinimumLength(nameof(shareName),shareName,3); + await eventListener.AssertMaximumLength(nameof(shareName),shareName,63); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Create or update the properties of a local user associated with the storage account + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// The local user associated with a storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersCreateOrUpdate(string resourceGroupName, string accountName, string subscriptionId, string username, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/localUsers/" + + global::System.Uri.EscapeDataString(username) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Create or update the properties of a local user associated with the storage account + /// + /// + /// The local user associated with a storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/localUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var username = _match.Groups["username"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/localUsers/" + + username + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUser.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// The local user associated with a storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersCreateOrUpdate_Validate(string resourceGroupName, string accountName, string subscriptionId, string username, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(username),username); + await eventListener.AssertMinimumLength(nameof(username),username,3); + await eventListener.AssertMaximumLength(nameof(username),username,64); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the local user associated with the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersDelete(string resourceGroupName, string accountName, string subscriptionId, string username, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/localUsers/" + + global::System.Uri.EscapeDataString(username) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Deletes the local user associated with the specified storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/localUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var username = _match.Groups["username"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/localUsers/" + + username + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, string username, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(username),username); + await eventListener.AssertMinimumLength(nameof(username),username,3); + await eventListener.AssertMaximumLength(nameof(username),username,64); + } + } + + /// Get the local user of the storage account by username. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersGet(string resourceGroupName, string accountName, string subscriptionId, string username, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/localUsers/" + + global::System.Uri.EscapeDataString(username) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the local user of the storage account by username. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/localUsers/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var username = _match.Groups["username"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/localUsers/" + + username + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUser.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersGet_Validate(string resourceGroupName, string accountName, string subscriptionId, string username, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(username),username); + await eventListener.AssertMinimumLength(nameof(username),username,3); + await eventListener.AssertMaximumLength(nameof(username),username,64); + } + } + + /// List the local users associated with the storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/localUsers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List SSH authorized keys and shared key of the local user. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersListKeys(string resourceGroupName, string accountName, string subscriptionId, string username, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/localUsers/" + + global::System.Uri.EscapeDataString(username) + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersListKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List SSH authorized keys and shared key of the local user. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersListKeysViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/localUsers/(?[^/]+)/listKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var username = _match.Groups["username"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/localUsers/" + + username + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersListKeys_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersListKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserKeys.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersListKeys_Validate(string resourceGroupName, string accountName, string subscriptionId, string username, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(username),username); + await eventListener.AssertMinimumLength(nameof(username),username,3); + await eventListener.AssertMaximumLength(nameof(username),username,64); + } + } + + /// List the local users associated with the storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/localUsers$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/localUsers" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUsers.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Regenerate the local user SSH password. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersRegeneratePassword(string resourceGroupName, string accountName, string subscriptionId, string username, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/localUsers/" + + global::System.Uri.EscapeDataString(username) + + "/regeneratePassword" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersRegeneratePassword_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Regenerate the local user SSH password. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task LocalUsersRegeneratePasswordViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/localUsers/(?[^/]+)/regeneratePassword$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var username = _match.Groups["username"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/localUsers/" + + username + + "/regeneratePassword" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.LocalUsersRegeneratePassword_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersRegeneratePassword_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUserRegeneratePasswordResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of local user. The username must contain lowercase letters and numbers only. It must be + /// unique only within the storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task LocalUsersRegeneratePassword_Validate(string resourceGroupName, string accountName, string subscriptionId, string username, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(username),username); + await eventListener.AssertMinimumLength(nameof(username),username,3); + await eventListener.AssertMaximumLength(nameof(username),username,64); + } + } + + /// Sets the managementpolicy to the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The ManagementPolicy set to a storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagementPoliciesCreateOrUpdate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var managementPolicyName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/managementPolicies/" + + global::System.Uri.EscapeDataString(managementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementPoliciesCreateOrUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Sets the managementpolicy to the specified storage account. + /// + /// The ManagementPolicy set to a storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagementPoliciesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/managementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var managementPolicyName = _match.Groups["managementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/managementPolicies/" + + managementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementPoliciesCreateOrUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagementPoliciesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The ManagementPolicy set to a storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagementPoliciesCreateOrUpdate_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes the managementpolicy associated with the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagementPoliciesDelete(string resourceGroupName, string accountName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var managementPolicyName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/managementPolicies/" + + global::System.Uri.EscapeDataString(managementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementPoliciesDelete_Call(request,onOk,onNoContent,eventListener,sender); + } + } + + /// Deletes the managementpolicy associated with the specified storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagementPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/managementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var managementPolicyName = _match.Groups["managementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/managementPolicies/" + + managementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementPoliciesDelete_Call(request,onOk,onNoContent,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagementPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagementPoliciesDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Gets the managementpolicy associated with the specified storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagementPoliciesGet(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var managementPolicyName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/managementPolicies/" + + global::System.Uri.EscapeDataString(managementPolicyName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementPoliciesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Gets the managementpolicy associated with the specified storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ManagementPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/managementPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var managementPolicyName = _match.Groups["managementPolicyName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/managementPolicies/" + + managementPolicyName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ManagementPoliciesGet_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagementPoliciesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ManagementPoliciesGet_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Create or update the object replication policy of the storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// For the destination account, provide the value 'default'. Configure the policy + /// on the destination account first. For the source account, provide the value of the policy ID that is returned when you + /// download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + /// The object replication policy set to a storage account. A unique policy ID will be created if absent. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesCreateOrUpdate(string resourceGroupName, string accountName, string subscriptionId, string objectReplicationPolicyId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/objectReplicationPolicies/" + + global::System.Uri.EscapeDataString(objectReplicationPolicyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Create or update the object replication policy of the storage account. + /// + /// The object replication policy set to a storage account. A unique policy ID will be created if absent. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesCreateOrUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/objectReplicationPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var objectReplicationPolicyId = _match.Groups["objectReplicationPolicyId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/objectReplicationPolicies/" + + objectReplicationPolicyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesCreateOrUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesCreateOrUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// For the destination account, provide the value 'default'. Configure the policy + /// on the destination account first. For the source account, provide the value of the policy ID that is returned when you + /// download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + /// The object replication policy set to a storage account. A unique policy ID will be created if absent. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesCreateOrUpdate_Validate(string resourceGroupName, string accountName, string subscriptionId, string objectReplicationPolicyId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(objectReplicationPolicyId),objectReplicationPolicyId); + await eventListener.AssertMinimumLength(nameof(objectReplicationPolicyId),objectReplicationPolicyId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes the object replication policy associated with the specified storage account. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// For the destination account, provide the value 'default'. Configure the policy + /// on the destination account first. For the source account, provide the value of the policy ID that is returned when you + /// download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesDelete(string resourceGroupName, string accountName, string subscriptionId, string objectReplicationPolicyId, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/objectReplicationPolicies/" + + global::System.Uri.EscapeDataString(objectReplicationPolicyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes the object replication policy associated with the specified storage account. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/objectReplicationPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var objectReplicationPolicyId = _match.Groups["objectReplicationPolicyId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/objectReplicationPolicies/" + + objectReplicationPolicyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// For the destination account, provide the value 'default'. Configure the policy + /// on the destination account first. For the source account, provide the value of the policy ID that is returned when you + /// download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, string objectReplicationPolicyId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(objectReplicationPolicyId),objectReplicationPolicyId); + await eventListener.AssertMinimumLength(nameof(objectReplicationPolicyId),objectReplicationPolicyId,1); + } + } + + /// Get the object replication policy of the storage account by policy ID. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// For the destination account, provide the value 'default'. Configure the policy + /// on the destination account first. For the source account, provide the value of the policy ID that is returned when you + /// download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesGet(string resourceGroupName, string accountName, string subscriptionId, string objectReplicationPolicyId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/objectReplicationPolicies/" + + global::System.Uri.EscapeDataString(objectReplicationPolicyId) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Get the object replication policy of the storage account by policy ID. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/objectReplicationPolicies/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var objectReplicationPolicyId = _match.Groups["objectReplicationPolicyId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/objectReplicationPolicies/" + + objectReplicationPolicyId + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicy.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// For the destination account, provide the value 'default'. Configure the policy + /// on the destination account first. For the source account, provide the value of the policy ID that is returned when you + /// download the policy that was defined on the destination account. The policy is downloaded as a JSON file. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesGet_Validate(string resourceGroupName, string accountName, string subscriptionId, string objectReplicationPolicyId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(objectReplicationPolicyId),objectReplicationPolicyId); + await eventListener.AssertMinimumLength(nameof(objectReplicationPolicyId),objectReplicationPolicyId,1); + } + } + + /// List the object replication policies associated with the storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/objectReplicationPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List the object replication policies associated with the storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task ObjectReplicationPoliciesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/objectReplicationPolicies$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/objectReplicationPolicies" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.ObjectReplicationPoliciesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicies.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task ObjectReplicationPoliciesList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Lists all of the available Storage Rest API operations. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsList(global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Storage/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,eventListener,sender); + } + } + + /// Lists all of the available Storage Rest API operations. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task OperationsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/providers/Microsoft.Storage/operations$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/providers/Microsoft.Storage/operations'"); + } + + // replace URI parameters with values from identity + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/providers/Microsoft.Storage/operations" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.OperationsList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.OperationListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task OperationsList_Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + + } + } + + /// + /// Deletes the specified private endpoint connection associated with the storage account. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the private endpoint connection associated with the Azure resource + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete(string resourceGroupName, string accountName, string subscriptionId, string privateEndpointConnectionName, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes the specified private endpoint connection associated with the storage account. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsDelete_Call(request,onOk,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the private endpoint connection associated with the Azure resource + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// + /// Gets the specified private endpoint connection associated with the storage account. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the private endpoint connection associated with the Azure resource + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet(string resourceGroupName, string accountName, string subscriptionId, string privateEndpointConnectionName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the specified private endpoint connection associated with the storage account. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the private endpoint connection associated with the Azure resource + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsGet_Validate(string resourceGroupName, string accountName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + } + } + + /// List all the private endpoint connections associated with the storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsList_Call(request,onOk,eventListener,sender); + } + } + + /// List all the private endpoint connections associated with the storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/privateEndpointConnections$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/privateEndpointConnections" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnectionListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Update the state of specified private endpoint connection associated with the storage account. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsPut(string resourceGroupName, string accountName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/privateEndpointConnections/" + + global::System.Uri.EscapeDataString(privateEndpointConnectionName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Update the state of specified private endpoint connection associated with the storage account. + /// + /// + /// The private endpoint connection properties. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateEndpointConnectionsPutViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/privateEndpointConnections/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var privateEndpointConnectionName = _match.Groups["privateEndpointConnectionName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/privateEndpointConnections/" + + privateEndpointConnectionName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateEndpointConnectionsPut_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsPut_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateEndpointConnection.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The name of the private endpoint connection associated with the Azure resource + /// The private endpoint connection properties. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateEndpointConnectionsPut_Validate(string resourceGroupName, string accountName, string subscriptionId, string privateEndpointConnectionName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(privateEndpointConnectionName),privateEndpointConnectionName); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Gets the private link resources that need to be created for a storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByStorageAccount(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesListByStorageAccount_Call(request,onOk,eventListener,sender); + } + } + + /// Gets the private link resources that need to be created for a storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task PrivateLinkResourcesListByStorageAccountViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/privateLinkResources$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/privateLinkResources" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.PrivateLinkResourcesListByStorageAccount_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByStorageAccount_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.PrivateLinkResourceListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task PrivateLinkResourcesListByStorageAccount_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Creates a new queue with the specified queue name, under the specified account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// Queue properties and metadata to be created with + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueCreate(string resourceGroupName, string accountName, string subscriptionId, string queueName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices/default/queues/" + + global::System.Uri.EscapeDataString(queueName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new queue with the specified queue name, under the specified account. + /// + /// Queue properties and metadata to be created with + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices/default/queues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var queueName = _match.Groups["queueName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices/default/queues/" + + queueName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// Queue properties and metadata to be created with + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueCreate_Validate(string resourceGroupName, string accountName, string subscriptionId, string queueName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(queueName),queueName); + await eventListener.AssertMinimumLength(nameof(queueName),queueName,3); + await eventListener.AssertMaximumLength(nameof(queueName),queueName,63); + await eventListener.AssertRegEx(nameof(queueName),queueName,@"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes the queue with the specified queue name, under the specified account if it exists. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueDelete(string resourceGroupName, string accountName, string subscriptionId, string queueName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices/default/queues/" + + global::System.Uri.EscapeDataString(queueName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes the queue with the specified queue name, under the specified account if it exists. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices/default/queues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var queueName = _match.Groups["queueName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices/default/queues/" + + queueName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, string queueName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(queueName),queueName); + await eventListener.AssertMinimumLength(nameof(queueName),queueName,3); + await eventListener.AssertMaximumLength(nameof(queueName),queueName,63); + await eventListener.AssertRegEx(nameof(queueName),queueName,@"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$"); + } + } + + /// + /// Gets the queue with the specified queue name, under the specified account if it exists. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueGet(string resourceGroupName, string accountName, string subscriptionId, string queueName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices/default/queues/" + + global::System.Uri.EscapeDataString(queueName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the queue with the specified queue name, under the specified account if it exists. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices/default/queues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var queueName = _match.Groups["queueName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices/default/queues/" + + queueName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueGet_Validate(string resourceGroupName, string accountName, string subscriptionId, string queueName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(queueName),queueName); + await eventListener.AssertMinimumLength(nameof(queueName),queueName,3); + await eventListener.AssertMaximumLength(nameof(queueName),queueName,63); + await eventListener.AssertRegEx(nameof(queueName),queueName,@"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$"); + } + } + + /// Gets a list of all the queues under the specified storage account + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Optional, a maximum number of queues that should be included in a list queue response + /// Optional, When specified, only the queues with a name starting with the given filter will be listed. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueList(string resourceGroupName, string accountName, string subscriptionId, string Maxpagesize, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices/default/queues" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of all the queues under the specified storage account + /// + /// Optional, a maximum number of queues that should be included in a list queue response + /// Optional, When specified, only the queues with a name starting with the given filter will be listed. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueListViaIdentity(global::System.String viaIdentity, string Maxpagesize, string Filter, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices/default/queues$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices/default/queues" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Maxpagesize) ? global::System.String.Empty : "$maxpagesize=" + global::System.Uri.EscapeDataString(Maxpagesize)) + + "&" + + (string.IsNullOrEmpty(Filter) ? global::System.String.Empty : "$filter=" + global::System.Uri.EscapeDataString(Filter)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Optional, a maximum number of queues that should be included in a list queue response + /// Optional, When specified, only the queues with a name starting with the given filter will be listed. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueList_Validate(string resourceGroupName, string accountName, string subscriptionId, string Maxpagesize, string Filter, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(Maxpagesize),Maxpagesize); + await eventListener.AssertNotNull(nameof(Filter),Filter); + } + } + + /// + /// Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueServicesGetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var queueServiceName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices/" + + global::System.Uri.EscapeDataString(queueServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueServicesGetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueServicesGetServicePropertiesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var queueServiceName = _match.Groups["queueServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices/" + + queueServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueServicesGetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueServicesGetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueServicesGetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// List all queue services for the storage account + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueServicesList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all queue services for the storage account + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueServicesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueServicesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListQueueServices.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueServicesList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of a storage account’s Queue service, only properties for Storage Analytics and CORS + /// (Cross-Origin Resource Sharing) rules can be specified. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueServicesSetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var queueServiceName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices/" + + global::System.Uri.EscapeDataString(queueServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueServicesSetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Sets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// The properties of a storage account’s Queue service, only properties for Storage Analytics and CORS + /// (Cross-Origin Resource Sharing) rules can be specified. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueServicesSetServicePropertiesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var queueServiceName = _match.Groups["queueServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices/" + + queueServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueServicesSetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueServicesSetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.QueueServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of a storage account’s Queue service, only properties for Storage Analytics and CORS + /// (Cross-Origin Resource Sharing) rules can be specified. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueServicesSetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new queue with the specified queue name, under the specified account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// Queue properties and metadata to be created with + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueUpdate(string resourceGroupName, string accountName, string subscriptionId, string queueName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/queueServices/default/queues/" + + global::System.Uri.EscapeDataString(queueName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new queue with the specified queue name, under the specified account. + /// + /// Queue properties and metadata to be created with + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task QueueUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/queueServices/default/queues/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var queueName = _match.Groups["queueName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/queueServices/default/queues/" + + queueName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.QueueUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric + /// character and it cannot have two consecutive dash(-) characters. + /// Queue properties and metadata to be created with + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task QueueUpdate_Validate(string resourceGroupName, string accountName, string subscriptionId, string queueName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(queueName),queueName); + await eventListener.AssertMinimumLength(nameof(queueName),queueName,3); + await eventListener.AssertMaximumLength(nameof(queueName),queueName,63); + await eventListener.AssertRegEx(nameof(queueName),queueName,@"^[a-z0-9]([a-z0-9]|(-(?!-))){1,61}[a-z0-9]$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Lists the available SKUs supported by Microsoft.Storage for given subscription. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SkusList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Storage/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SkusList_Call(request,onOk,eventListener,sender); + } + } + + /// Lists the available SKUs supported by Microsoft.Storage for given subscription. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task SkusListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Storage/skus$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Storage/skus" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.SkusList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SkusList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageSkuListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task SkusList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Abort live Migration of storage account to enable Hns + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsAbortHierarchicalNamespaceMigration(string resourceGroupName, string accountName, string subscriptionId, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/aborthnsonmigration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsAbortHierarchicalNamespaceMigration_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Abort live Migration of storage account to enable Hns + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsAbortHierarchicalNamespaceMigrationViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/aborthnsonmigration$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/aborthnsonmigration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsAbortHierarchicalNamespaceMigration_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsAbortHierarchicalNamespaceMigration_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual + /// call, but you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsAbortHierarchicalNamespaceMigration_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// Checks that the storage account name is valid and is not already in use. + /// The ID of the target subscription. + /// The name of the storage account within the specified resource group. Storage account names must be + /// between 3 and 24 characters in length and use numbers and lower-case letters only. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsCheckNameAvailability(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Storage/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsCheckNameAvailability_Call(request,onOk,eventListener,sender); + } + } + + /// Checks that the storage account name is valid and is not already in use. + /// + /// The name of the storage account within the specified resource group. Storage account names must be + /// between 3 and 24 characters in length and use numbers and lower-case letters only. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsCheckNameAvailabilityViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Storage/checkNameAvailability$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Storage/checkNameAvailability" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsCheckNameAvailability_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsCheckNameAvailability_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CheckNameAvailabilityResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The ID of the target subscription. + /// The name of the storage account within the specified resource group. Storage account names must be + /// between 3 and 24 characters in length and use numbers and lower-case letters only. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsCheckNameAvailability_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent + /// create request is issued with different properties, the account properties will be updated. If an account is already created + /// and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide for the created account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsCreate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsCreate_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent + /// create request is issued with different properties, the account properties will be updated. If an account is already created + /// and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + /// + /// + /// The parameters to provide for the created account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsCreate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: default + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + if (!string.IsNullOrWhiteSpace(_originalUri)) + { + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_originalUri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccount.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide for the created account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsCreate_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Deletes a storage account in Microsoft Azure. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsDelete(string resourceGroupName, string accountName, string subscriptionId, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsDelete_Call(request,onOk,onNoContent,eventListener,sender); + } + } + + /// Deletes a storage account in Microsoft Azure. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsDelete_Call(request,onOk,onNoContent,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns 204 (NoContent). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func onNoContent, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage + /// account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsFailover(string resourceGroupName, string accountName, string subscriptionId, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/failover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsFailover_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Failover request can be triggered for a storage account in case of availability issues. The failover occurs from the storage + /// account's primary cluster to secondary cluster for RA-GRS accounts. The secondary cluster will become primary after failover. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsFailoverViaIdentity(global::System.String viaIdentity, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/failover$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/failover'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/failover" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsFailover_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsFailover_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsFailover_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account + /// status. The ListKeys operation should be used to retrieve storage keys. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// May be used to expand the properties within account's properties. By default, data is not included + /// when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsGetProperties(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand? Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsGetProperties_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account + /// status. The ListKeys operation should be used to retrieve storage keys. + /// + /// + /// May be used to expand the properties within account's properties. By default, data is not included + /// when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsGetPropertiesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand? Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsGetProperties_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsGetProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccount.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// May be used to expand the properties within account's properties. By default, data is not included + /// when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsGetProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand? Expand, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertEnum(nameof(Expand),Expand,@"geoReplicationStats", @"blobRestoreStatus"); + } + } + + /// Live Migration of storage account to enable Hns + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Required. Hierarchical namespace migration type can either be a hierarchical namespace validation + /// request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate + /// the migration whereas the hydration request will migrate the account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsHierarchicalNamespaceMigration(string resourceGroupName, string accountName, string subscriptionId, string requestType, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourcegroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/hnsonmigration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "requestType=" + global::System.Uri.EscapeDataString(requestType) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsHierarchicalNamespaceMigration_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Live Migration of storage account to enable Hns + /// + /// Required. Hierarchical namespace migration type can either be a hierarchical namespace validation + /// request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate + /// the migration whereas the hydration request will migrate the account. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsHierarchicalNamespaceMigrationViaIdentity(global::System.String viaIdentity, string requestType, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourcegroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/hnsonmigration$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourcegroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/hnsonmigration" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + "requestType=" + global::System.Uri.EscapeDataString(requestType) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsHierarchicalNamespaceMigration_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsHierarchicalNamespaceMigration_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ErrorResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, + /// but you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Required. Hierarchical namespace migration type can either be a hierarchical namespace validation + /// request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate + /// the migration whereas the hydration request will migrate the account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsHierarchicalNamespaceMigration_Validate(string resourceGroupName, string accountName, string subscriptionId, string requestType, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(requestType),requestType); + } + } + + /// + /// Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys + /// operation for this. + /// + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsList(string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Storage/storageAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsList_Call(request,onOk,eventListener,sender); + } + } + + /// List SAS credentials of a storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide to list SAS credentials for the storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListAccountSas(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/ListAccountSas" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListAccountSas_Call(request,onOk,eventListener,sender); + } + } + + /// List SAS credentials of a storage account. + /// + /// The parameters to provide to list SAS credentials for the storage account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListAccountSasViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/ListAccountSas$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/ListAccountSas" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListAccountSas_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListAccountSas_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListAccountSasResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide to list SAS credentials for the storage account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListAccountSas_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use + /// the ListKeys operation for this. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListByResourceGroup(string resourceGroupName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListByResourceGroup_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use + /// the ListKeys operation for this. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListByResourceGroupViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListByResourceGroup_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListByResourceGroup_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListByResourceGroup_Validate(string resourceGroupName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Specifies type of the key to be listed. Possible value is kerb. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListKeys(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand? Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListKeys_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + /// + /// + /// Specifies type of the key to be listed. Possible value is kerb. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListKeysViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand? Expand, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/listKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/listKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + + "&" + + (string.IsNullOrEmpty(Expand) ? global::System.String.Empty : "$expand=" + global::System.Uri.EscapeDataString(Expand)) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListKeys_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountListKeysResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get + /// validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Specifies type of the key to be listed. Possible value is kerb. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListKeys_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand? Expand, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(Expand),Expand); + await eventListener.AssertEnum(nameof(Expand),Expand,@"kerb"); + } + } + + /// List service SAS credentials of a specific resource. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide to list service SAS credentials. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListServiceSas(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/ListServiceSas" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListServiceSas_Call(request,onOk,eventListener,sender); + } + } + + /// List service SAS credentials of a specific resource. + /// + /// The parameters to provide to list service SAS credentials. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListServiceSasViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/ListServiceSas$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/ListServiceSas" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsListServiceSas_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListServiceSas_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListServiceSasResponse.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide to list service SAS credentials. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsListServiceSas_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys + /// operation for this. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Storage/storageAccounts$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Storage/storageAccounts" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsList_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsList_Validate(string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Regenerates one of the access keys or Kerberos keys for the specified storage account. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsRegenerateKey(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsRegenerateKey_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Regenerates one of the access keys or Kerberos keys for the specified storage account. + /// + /// + /// Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsRegenerateKeyViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/regenerateKey$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/regenerateKey" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsRegenerateKey_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsRegenerateKey_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountListKeysResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will + /// get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// Specifies name of the key which should be regenerated -- key1, key2, kerb1, kerb2. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsRegenerateKey_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Restore blobs in the specified blob ranges + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide for restore blob ranges. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsRestoreBlobRanges(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/restoreBlobRanges" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsRestoreBlobRanges_Call(request,onOk,eventListener,sender); + } + } + + /// Restore blobs in the specified blob ranges + /// + /// The parameters to provide for restore blob ranges. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsRestoreBlobRangesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/restoreBlobRanges$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/restoreBlobRanges" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsRestoreBlobRanges_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsRestoreBlobRanges_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + // this operation supports x-ms-long-running-operation + var _originalUri = request.RequestUri.AbsoluteUri; + // declared final-state-via: location + var _finalUri = _response.GetFirstHeader(@"Location"); + var asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = _response.GetFirstHeader(@"Location"); + while (request.Method == System.Net.Http.HttpMethod.Put && _response.StatusCode == global::System.Net.HttpStatusCode.OK || _response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + + // get the delay before polling. (default to 30 seconds if not present) + int delay = (int)(_response.Headers.RetryAfter?.Delta?.TotalSeconds ?? 30); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling, $"Delaying {delay} seconds before polling.", _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // start the delay timer (we'll await later...) + var waiting = global::System.Threading.Tasks.Task.Delay(delay * 1000, eventListener.Token ); + + // while we wait, let's grab the headers and get ready to poll. + if (!System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Azure-AsyncOperation"))) { + asyncOperation = _response.GetFirstHeader(@"Azure-AsyncOperation"); + } + if (!global::System.String.IsNullOrEmpty(_response.GetFirstHeader(@"Location"))) { + location = _response.GetFirstHeader(@"Location"); + } + var _uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? _originalUri : location : asyncOperation; + request = request.CloneAndDispose(new global::System.Uri(_uri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // and let's look at the current response body and see if we have some information we can give back to the listener + var content = await _response.Content.ReadAsStringAsync(); + await waiting; + + // check for cancellation + if( eventListener.Token.IsCancellationRequested ) { return; } + + // drop the old response + _response?.Dispose(); + + // make the polling call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + + // if we got back an OK, take a peek inside and see if it's done + if( _response.StatusCode == global::System.Net.HttpStatusCode.OK) + { + var error = false; + try { + if( Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(await _response.Content.ReadAsStringAsync()) is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + var state = json.Property("properties")?.PropertyT("provisioningState") ?? json.PropertyT("status"); + if( state is null ) + { + // the body doesn't contain any information that has the state of the LRO + // we're going to just get out, and let the consumer have the result + break; + } + + switch( state?.ToString()?.ToLower() ) + { + case "failed": + error = true; + break; + case "succeeded": + case "canceled": + // we're done polling. + break; + + default: + // need to keep polling! + _response.StatusCode = global::System.Net.HttpStatusCode.Created; + continue; + } + } + } catch { + // if we run into a problem peeking into the result, + // we really don't want to do anything special. + } + if (error) { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + + // check for terminal status code + if (_response.StatusCode == global::System.Net.HttpStatusCode.Created || _response.StatusCode == global::System.Net.HttpStatusCode.Accepted ) + { + continue; + } + // we are done polling, do a request on final target? + // create a new request with the final uri + request = request.CloneAndDispose(new global::System.Uri(_finalUri), Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get); + + // drop the old response + _response?.Dispose(); + + // make the final call + _response = await sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Polling, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + break; + } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreStatus.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide for restore blob ranges. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsRestoreBlobRanges_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Revoke user delegation keys. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsRevokeUserDelegationKeys(string resourceGroupName, string accountName, string subscriptionId, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/revokeUserDelegationKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsRevokeUserDelegationKeys_Call(request,onOk,eventListener,sender); + } + } + + /// Revoke user delegation keys. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsRevokeUserDelegationKeysViaIdentity(global::System.String viaIdentity, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/revokeUserDelegationKeys$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/revokeUserDelegationKeys" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Post, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsRevokeUserDelegationKeys_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Actual wire call for method. + /// + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsRevokeUserDelegationKeys_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but + /// you will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsRevokeUserDelegationKeys_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also + /// be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change + /// of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered + /// before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys + /// for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name + /// of the storage account cannot be changed after creation. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide for the updated account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsUpdate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// + /// The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also + /// be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change + /// of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered + /// before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys + /// for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name + /// of the storage account cannot be changed after creation. + /// + /// + /// The parameters to provide for the updated account. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task StorageAccountsUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters body, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.StorageAccountsUpdate_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccount.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The parameters to provide for the updated account. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task StorageAccountsUpdate_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new table with the specified table name, under the specified account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// The parameters to provide to create a table. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableCreate(string resourceGroupName, string accountName, string subscriptionId, string tableName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices/default/tables/" + + global::System.Uri.EscapeDataString(tableName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new table with the specified table name, under the specified account. + /// + /// The parameters to provide to create a table. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableCreateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices/default/tables/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var tableName = _match.Groups["tableName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices/default/tables/" + + tableName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableCreate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableCreate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// The parameters to provide to create a table. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableCreate_Validate(string resourceGroupName, string accountName, string subscriptionId, string tableName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(tableName),tableName); + await eventListener.AssertMinimumLength(nameof(tableName),tableName,3); + await eventListener.AssertMaximumLength(nameof(tableName),tableName,63); + await eventListener.AssertRegEx(nameof(tableName),tableName,@"^[A-Za-z][A-Za-z0-9]{2,62}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Deletes the table with the specified table name, under the specified account if it exists. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableDelete(string resourceGroupName, string accountName, string subscriptionId, string tableName, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices/default/tables/" + + global::System.Uri.EscapeDataString(tableName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// + /// Deletes the table with the specified table name, under the specified account if it exists. + /// + /// + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableDeleteViaIdentity(global::System.String viaIdentity, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices/default/tables/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var tableName = _match.Groups["tableName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices/default/tables/" + + tableName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Delete, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableDelete_Call(request,onNoContent,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 204 (NoContent). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableDelete_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func onNoContent, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.NoContent: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onNoContent(_response); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableDelete_Validate(string resourceGroupName, string accountName, string subscriptionId, string tableName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(tableName),tableName); + await eventListener.AssertMinimumLength(nameof(tableName),tableName,3); + await eventListener.AssertMaximumLength(nameof(tableName),tableName,63); + await eventListener.AssertRegEx(nameof(tableName),tableName,@"^[A-Za-z][A-Za-z0-9]{2,62}$"); + } + } + + /// + /// Gets the table with the specified table name, under the specified account if it exists. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableGet(string resourceGroupName, string accountName, string subscriptionId, string tableName, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices/default/tables/" + + global::System.Uri.EscapeDataString(tableName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the table with the specified table name, under the specified account if it exists. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableGetViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices/default/tables/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var tableName = _match.Groups["tableName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices/default/tables/" + + tableName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableGet_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableGet_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableGet_Validate(string resourceGroupName, string accountName, string subscriptionId, string tableName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(tableName),tableName); + await eventListener.AssertMinimumLength(nameof(tableName),tableName,3); + await eventListener.AssertMaximumLength(nameof(tableName),tableName,63); + await eventListener.AssertRegEx(nameof(tableName),tableName,@"^[A-Za-z][A-Za-z0-9]{2,62}$"); + } + } + + /// Gets a list of all the tables under the specified storage account + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices/default/tables" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Gets a list of all the tables under the specified storage account + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices/default/tables$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices/default/tables" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListTableResource.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableServicesGetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var tableServiceName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices/" + + global::System.Uri.EscapeDataString(tableServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableServicesGetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableServicesGetServicePropertiesViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var tableServiceName = _match.Groups["tableServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices/" + + tableServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableServicesGetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableServicesGetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableServicesGetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// List all table services for the storage account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableServicesList(string resourceGroupName, string accountName, string subscriptionId, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// List all table services for the storage account. + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableServicesListViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableServicesList_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableServicesList_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ListTableServices.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableServicesList_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + } + } + + /// + /// Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of a storage account’s Table service, only properties for Storage Analytics and CORS + /// (Cross-Origin Resource Sharing) rules can be specified. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableServicesSetServiceProperties(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + var tableServiceName = @"default"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices/" + + global::System.Uri.EscapeDataString(tableServiceName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableServicesSetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// + /// Sets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// The properties of a storage account’s Table service, only properties for Storage Analytics and CORS + /// (Cross-Origin Resource Sharing) rules can be specified. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableServicesSetServicePropertiesViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var tableServiceName = _match.Groups["tableServiceName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices/" + + tableServiceName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Put, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableServicesSetServiceProperties_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableServicesSetServiceProperties_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.TableServiceProperties.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you + /// will get validation events back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// The properties of a storage account’s Table service, only properties for Storage Analytics and CORS + /// (Cross-Origin Resource Sharing) rules can be specified. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableServicesSetServiceProperties_Validate(string resourceGroupName, string accountName, string subscriptionId, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// Creates a new table with the specified table name, under the specified account. + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// The parameters to provide to create a table. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableUpdate(string resourceGroupName, string accountName, string subscriptionId, string tableName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/resourceGroups/" + + global::System.Uri.EscapeDataString(resourceGroupName) + + "/providers/Microsoft.Storage/storageAccounts/" + + global::System.Uri.EscapeDataString(accountName) + + "/tableServices/default/tables/" + + global::System.Uri.EscapeDataString(tableName) + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Creates a new table with the specified table name, under the specified account. + /// + /// The parameters to provide to create a table. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task TableUpdateViaIdentity(global::System.String viaIdentity, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable body, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/resourceGroups/(?[^/]+)/providers/Microsoft.Storage/storageAccounts/(?[^/]+)/tableServices/default/tables/(?[^/]+)$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}'"); + } + + // replace URI parameters with values from identity + var resourceGroupName = _match.Groups["resourceGroupName"].Value; + var accountName = _match.Groups["accountName"].Value; + var subscriptionId = _match.Groups["subscriptionId"].Value; + var tableName = _match.Groups["tableName"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/resourceGroups/" + + resourceGroupName + + "/providers/Microsoft.Storage/storageAccounts/" + + accountName + + "/tableServices/default/tables/" + + tableName + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Patch, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // set body content + request.Content = new global::System.Net.Http.StringContent(null != body ? body.ToJson(null).ToString() : @"{}", global::System.Text.Encoding.UTF8); + request.Content.Headers.ContentType = global::System.Net.Http.Headers.MediaTypeHeaderValue.Parse("application/json"); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BodyContentSet); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.TableUpdate_Call(request,onOk,onDefault,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// a delegate that is called when the remote service returns default (any response code not handled + /// elsewhere). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableUpdate_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, global::System.Func, global::System.Threading.Tasks.Task> onDefault, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onDefault(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.CloudError.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation events + /// back. + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// The name of the storage account within the specified resource group. Storage account names must + /// be between 3 and 24 characters in length and use numbers and lower-case letters only. + /// The ID of the target subscription. + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The + /// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. + /// The parameters to provide to create a table. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task TableUpdate_Validate(string resourceGroupName, string accountName, string subscriptionId, string tableName, Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable body, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(resourceGroupName),resourceGroupName); + await eventListener.AssertMinimumLength(nameof(resourceGroupName),resourceGroupName,1); + await eventListener.AssertMaximumLength(nameof(resourceGroupName),resourceGroupName,90); + await eventListener.AssertRegEx(nameof(resourceGroupName),resourceGroupName,@"^[-\w\._\(\)]+$"); + await eventListener.AssertNotNull(nameof(accountName),accountName); + await eventListener.AssertMinimumLength(nameof(accountName),accountName,3); + await eventListener.AssertMaximumLength(nameof(accountName),accountName,24); + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(tableName),tableName); + await eventListener.AssertMinimumLength(nameof(tableName),tableName,3); + await eventListener.AssertMaximumLength(nameof(tableName),tableName,63); + await eventListener.AssertRegEx(nameof(tableName),tableName,@"^[A-Za-z][A-Za-z0-9]{2,62}$"); + await eventListener.AssertNotNull(nameof(body), body); + await eventListener.AssertObjectIsValid(nameof(body), body); + } + } + + /// + /// Gets the current usage count and the limit for the resources of the location under the subscription. + /// + /// The ID of the target subscription. + /// The location of the Azure Storage resource. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsagesListByLocation(string subscriptionId, string location, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + global::System.Uri.EscapeDataString(subscriptionId) + + "/providers/Microsoft.Storage/locations/" + + global::System.Uri.EscapeDataString(location) + + "/usages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsagesListByLocation_Call(request,onOk,eventListener,sender); + } + } + + /// + /// Gets the current usage count and the limit for the resources of the location under the subscription. + /// + /// + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + public async global::System.Threading.Tasks.Task UsagesListByLocationViaIdentity(global::System.String viaIdentity, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + var apiVersion = @"2022-05-01"; + // Constant Parameters + using( NoSynchronizationContext ) + { + // verify that Identity format is an exact match for uri + + var _match = new global::System.Text.RegularExpressions.Regex("^/subscriptions/(?[^/]+)/providers/Microsoft.Storage/locations/(?[^/]+)/usages$", global::System.Text.RegularExpressions.RegexOptions.IgnoreCase).Match(viaIdentity); + if (!_match.Success) + { + throw new global::System.Exception("Invalid identity for URI '/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages'"); + } + + // replace URI parameters with values from identity + var subscriptionId = _match.Groups["subscriptionId"].Value; + var location = _match.Groups["location"].Value; + // construct URL + var pathAndQuery = global::System.Text.RegularExpressions.Regex.Replace( + "/subscriptions/" + + subscriptionId + + "/providers/Microsoft.Storage/locations/" + + location + + "/usages" + + "?" + + "api-version=" + global::System.Uri.EscapeDataString(apiVersion) + ,"\\?&*$|&*$|(\\?)&+|(&)&+","$1$2"); + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.URLCreated, pathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + // generate request object + var _url = new global::System.Uri($"https://management.azure.com{pathAndQuery}"); + var request = new global::System.Net.Http.HttpRequestMessage(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get, _url); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.RequestCreated, request.RequestUri.PathAndQuery); if( eventListener.Token.IsCancellationRequested ) { return; } + + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.HeaderParametersAdded); if( eventListener.Token.IsCancellationRequested ) { return; } + // make the call + await this.UsagesListByLocation_Call(request,onOk,eventListener,sender); + } + } + + /// Actual wire call for method. + /// the prepared HttpRequestMessage to send. + /// a delegate that is called when the remote service returns 200 (OK). + /// an instance that will receive events. + /// an instance of an Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync pipeline to use to make the request. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsagesListByLocation_Call(global::System.Net.Http.HttpRequestMessage request, global::System.Func, global::System.Threading.Tasks.Task> onOk, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.ISendAsync sender) + { + using( NoSynchronizationContext ) + { + global::System.Net.Http.HttpResponseMessage _response = null; + try + { + var sendTask = sender.SendAsync(request, eventListener); + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeCall, request); if( eventListener.Token.IsCancellationRequested ) { return; } + _response = await sendTask; + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ResponseCreated, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + var _contentType = _response.Content.Headers.ContentType?.MediaType; + + switch ( _response.StatusCode ) + { + case global::System.Net.HttpStatusCode.OK: + { + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.BeforeResponseDispatch, _response); if( eventListener.Token.IsCancellationRequested ) { return; } + await onOk(_response,_response.Content.ReadAsStringAsync().ContinueWith( body => Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.UsageListResult.FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(body.Result)) )); + break; + } + default: + { + throw new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException(_response); + } + } + } + finally + { + // finally statements + await eventListener.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Finally, request, _response); + _response?.Dispose(); + request?.Dispose(); + } + } + } + + /// + /// Validation method for method. Call this like the actual call, but you will get validation + /// events back. + /// + /// The ID of the target subscription. + /// The location of the Azure Storage resource. + /// an instance that will receive events. + /// + /// A that will be complete when handling of the response is completed. + /// + internal async global::System.Threading.Tasks.Task UsagesListByLocation_Validate(string subscriptionId, string location, Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener eventListener) + { + using( NoSynchronizationContext ) + { + await eventListener.AssertNotNull(nameof(subscriptionId),subscriptionId); + await eventListener.AssertMinimumLength(nameof(subscriptionId),subscriptionId,1); + await eventListener.AssertNotNull(nameof(location),location); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccessTier.Completer.cs b/swaggerci/storage/generated/api/Support/AccessTier.Completer.cs new file mode 100644 index 000000000000..8a588f82e147 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccessTier.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTierTypeConverter))] + public partial struct AccessTier : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Hot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Hot'", "Hot", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hot"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cool".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cool'", "Cool", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cool"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Premium".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Premium'", "Premium", global::System.Management.Automation.CompletionResultType.ParameterValue, "Premium"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccessTier.TypeConverter.cs b/swaggerci/storage/generated/api/Support/AccessTier.TypeConverter.cs new file mode 100644 index 000000000000..6fa90dfda9d4 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccessTier.TypeConverter.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + public partial class AccessTierTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AccessTier.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccessTier.cs b/swaggerci/storage/generated/api/Support/AccessTier.cs new file mode 100644 index 000000000000..f52a1d09ec93 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccessTier.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + public partial struct AccessTier : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier Cool = @"Cool"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier Hot = @"Hot"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier Premium = @"Premium"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AccessTier(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccessTier + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccessTier(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccessTier + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AccessTier (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AccessTier && Equals((AccessTier)obj); + } + + /// Returns hashCode for enum AccessTier + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccessTier + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccessTier + /// the value to convert to an instance of . + + public static implicit operator AccessTier(string value) + { + return new AccessTier(value); + } + + /// Implicit operator to convert AccessTier to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier e) + { + return e._value; + } + + /// Overriding != operator for enum AccessTier + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccessTier + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.Completer.cs b/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.Completer.cs new file mode 100644 index 000000000000..f56962640571 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.Completer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyStateTypeConverter))] + public partial struct AccountImmutabilityPolicyState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unlocked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unlocked'", "Unlocked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unlocked"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Locked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Locked'", "Locked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Locked"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.TypeConverter.cs new file mode 100644 index 000000000000..858dc7277f50 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.TypeConverter.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + public partial class AccountImmutabilityPolicyStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AccountImmutabilityPolicyState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.cs b/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.cs new file mode 100644 index 000000000000..4b3e3c964a25 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountImmutabilityPolicyState.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + public partial struct AccountImmutabilityPolicyState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState Locked = @"Locked"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState Unlocked = @"Unlocked"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private AccountImmutabilityPolicyState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccountImmutabilityPolicyState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccountImmutabilityPolicyState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccountImmutabilityPolicyState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type AccountImmutabilityPolicyState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AccountImmutabilityPolicyState && Equals((AccountImmutabilityPolicyState)obj); + } + + /// Returns hashCode for enum AccountImmutabilityPolicyState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccountImmutabilityPolicyState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccountImmutabilityPolicyState + /// the value to convert to an instance of . + + public static implicit operator AccountImmutabilityPolicyState(string value) + { + return new AccountImmutabilityPolicyState(value); + } + + /// Implicit operator to convert AccountImmutabilityPolicyState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState e) + { + return e._value; + } + + /// Overriding != operator for enum AccountImmutabilityPolicyState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccountImmutabilityPolicyState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountStatus.Completer.cs b/swaggerci/storage/generated/api/Support/AccountStatus.Completer.cs new file mode 100644 index 000000000000..aaac5555635a --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountStatus.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatusTypeConverter))] + public partial struct AccountStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'available'", "available", global::System.Management.Automation.CompletionResultType.ParameterValue, "available"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "unavailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'unavailable'", "unavailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "unavailable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Support/AccountStatus.TypeConverter.cs new file mode 100644 index 000000000000..605f98597259 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountStatus.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + public partial class AccountStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AccountStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountStatus.cs b/swaggerci/storage/generated/api/Support/AccountStatus.cs new file mode 100644 index 000000000000..b274d83f370f --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountStatus.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Gets the status indicating whether the primary location of the storage account is available or unavailable. + /// + public partial struct AccountStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus Available = @"available"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus Unavailable = @"unavailable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AccountStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccountStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccountStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccountStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AccountStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AccountStatus && Equals((AccountStatus)obj); + } + + /// Returns hashCode for enum AccountStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccountStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccountStatus + /// the value to convert to an instance of . + + public static implicit operator AccountStatus(string value) + { + return new AccountStatus(value); + } + + /// Implicit operator to convert AccountStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus e) + { + return e._value; + } + + /// Overriding != operator for enum AccountStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccountStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountType.Completer.cs b/swaggerci/storage/generated/api/Support/AccountType.Completer.cs new file mode 100644 index 000000000000..5834378d93ab --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountType.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the Active Directory account type for Azure Storage. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountTypeTypeConverter))] + public partial struct AccountType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Computer".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Computer'", "Computer", global::System.Management.Automation.CompletionResultType.ParameterValue, "Computer"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/AccountType.TypeConverter.cs new file mode 100644 index 000000000000..3eec2b03e882 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the Active Directory account type for Azure Storage. + public partial class AccountTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AccountType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AccountType.cs b/swaggerci/storage/generated/api/Support/AccountType.cs new file mode 100644 index 000000000000..891868a5d428 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AccountType.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the Active Directory account type for Azure Storage. + public partial struct AccountType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType Computer = @"Computer"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType User = @"User"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AccountType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AccountType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AccountType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AccountType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AccountType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AccountType && Equals((AccountType)obj); + } + + /// Returns hashCode for enum AccountType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AccountType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AccountType + /// the value to convert to an instance of . + + public static implicit operator AccountType(string value) + { + return new AccountType(value); + } + + /// Implicit operator to convert AccountType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType e) + { + return e._value; + } + + /// Overriding != operator for enum AccountType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AccountType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Action.Completer.cs b/swaggerci/storage/generated/api/Support/Action.Completer.cs new file mode 100644 index 000000000000..9309e8b4172d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Action.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The action of virtual network rule. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ActionTypeConverter))] + public partial struct Action : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Allow".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Allow'", "Allow", global::System.Management.Automation.CompletionResultType.ParameterValue, "Allow"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Action.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Action.TypeConverter.cs new file mode 100644 index 000000000000..9de35863e06b --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Action.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The action of virtual network rule. + public partial class ActionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Action.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Action.cs b/swaggerci/storage/generated/api/Support/Action.cs new file mode 100644 index 000000000000..cd474a8f8d52 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Action.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The action of virtual network rule. + public partial struct Action : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action Allow = @"Allow"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Action(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to Action + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Action(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Action + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Action (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Action && Equals((Action)obj); + } + + /// Returns hashCode for enum Action + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Action + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Action + /// the value to convert to an instance of . + + public static implicit operator Action(string value) + { + return new Action(value); + } + + /// Implicit operator to convert Action to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action e) + { + return e._value; + } + + /// Overriding != operator for enum Action + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Action + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Action e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AllowedCopyScope.Completer.cs b/swaggerci/storage/generated/api/Support/AllowedCopyScope.Completer.cs new file mode 100644 index 000000000000..142150f90219 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AllowedCopyScope.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScopeTypeConverter))] + public partial struct AllowedCopyScope : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PrivateLink".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PrivateLink'", "PrivateLink", global::System.Management.Automation.CompletionResultType.ParameterValue, "PrivateLink"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AAD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AAD'", "AAD", global::System.Management.Automation.CompletionResultType.ParameterValue, "AAD"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AllowedCopyScope.TypeConverter.cs b/swaggerci/storage/generated/api/Support/AllowedCopyScope.TypeConverter.cs new file mode 100644 index 000000000000..c295c8ea6986 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AllowedCopyScope.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + public partial class AllowedCopyScopeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AllowedCopyScope.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AllowedCopyScope.cs b/swaggerci/storage/generated/api/Support/AllowedCopyScope.cs new file mode 100644 index 000000000000..79482631a881 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AllowedCopyScope.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + public partial struct AllowedCopyScope : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope Aad = @"AAD"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope PrivateLink = @"PrivateLink"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AllowedCopyScope(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AllowedCopyScope + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AllowedCopyScope(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AllowedCopyScope + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AllowedCopyScope (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AllowedCopyScope && Equals((AllowedCopyScope)obj); + } + + /// Returns hashCode for enum AllowedCopyScope + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AllowedCopyScope + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AllowedCopyScope + /// the value to convert to an instance of . + + public static implicit operator AllowedCopyScope(string value) + { + return new AllowedCopyScope(value); + } + + /// Implicit operator to convert AllowedCopyScope to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope e) + { + return e._value; + } + + /// Overriding != operator for enum AllowedCopyScope + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AllowedCopyScope + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AllowedMethods.Completer.cs b/swaggerci/storage/generated/api/Support/AllowedMethods.Completer.cs new file mode 100644 index 000000000000..421957386bc0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AllowedMethods.Completer.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for AllowedMethods. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethodsTypeConverter))] + public partial struct AllowedMethods : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "DELETE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'DELETE'", "DELETE", global::System.Management.Automation.CompletionResultType.ParameterValue, "DELETE"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "GET".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'GET'", "GET", global::System.Management.Automation.CompletionResultType.ParameterValue, "GET"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "HEAD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'HEAD'", "HEAD", global::System.Management.Automation.CompletionResultType.ParameterValue, "HEAD"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MERGE".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MERGE'", "MERGE", global::System.Management.Automation.CompletionResultType.ParameterValue, "MERGE"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "POST".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'POST'", "POST", global::System.Management.Automation.CompletionResultType.ParameterValue, "POST"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "OPTIONS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'OPTIONS'", "OPTIONS", global::System.Management.Automation.CompletionResultType.ParameterValue, "OPTIONS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PUT".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PUT'", "PUT", global::System.Management.Automation.CompletionResultType.ParameterValue, "PUT"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "PATCH".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'PATCH'", "PATCH", global::System.Management.Automation.CompletionResultType.ParameterValue, "PATCH"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AllowedMethods.TypeConverter.cs b/swaggerci/storage/generated/api/Support/AllowedMethods.TypeConverter.cs new file mode 100644 index 000000000000..3e4e31bd0f4e --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AllowedMethods.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for AllowedMethods. + public partial class AllowedMethodsTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => AllowedMethods.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/AllowedMethods.cs b/swaggerci/storage/generated/api/Support/AllowedMethods.cs new file mode 100644 index 000000000000..1d1aeb825f39 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/AllowedMethods.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct AllowedMethods : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Delete = @"DELETE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Get = @"GET"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Head = @"HEAD"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Merge = @"MERGE"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Options = @"OPTIONS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Patch = @"PATCH"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Post = @"POST"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods Put = @"PUT"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private AllowedMethods(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to AllowedMethods + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new AllowedMethods(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type AllowedMethods + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type AllowedMethods (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is AllowedMethods && Equals((AllowedMethods)obj); + } + + /// Returns hashCode for enum AllowedMethods + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for AllowedMethods + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to AllowedMethods + /// the value to convert to an instance of . + + public static implicit operator AllowedMethods(string value) + { + return new AllowedMethods(value); + } + + /// Implicit operator to convert AllowedMethods to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods e) + { + return e._value; + } + + /// Overriding != operator for enum AllowedMethods + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum AllowedMethods + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedMethods e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.Completer.cs b/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.Completer.cs new file mode 100644 index 000000000000..696cc2ff7da1 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for BlobInventoryPolicyName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyNameTypeConverter))] + public partial struct BlobInventoryPolicyName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'default'", "default", global::System.Management.Automation.CompletionResultType.ParameterValue, "default"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.TypeConverter.cs new file mode 100644 index 000000000000..4c4035955bbe --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for BlobInventoryPolicyName. + public partial class BlobInventoryPolicyNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BlobInventoryPolicyName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.cs b/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.cs new file mode 100644 index 000000000000..30264d08c97c --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobInventoryPolicyName.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct BlobInventoryPolicyName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private BlobInventoryPolicyName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BlobInventoryPolicyName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BlobInventoryPolicyName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BlobInventoryPolicyName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BlobInventoryPolicyName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BlobInventoryPolicyName && Equals((BlobInventoryPolicyName)obj); + } + + /// Returns hashCode for enum BlobInventoryPolicyName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BlobInventoryPolicyName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BlobInventoryPolicyName + /// the value to convert to an instance of . + + public static implicit operator BlobInventoryPolicyName(string value) + { + return new BlobInventoryPolicyName(value); + } + + /// Implicit operator to convert BlobInventoryPolicyName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName e) + { + return e._value; + } + + /// Overriding != operator for enum BlobInventoryPolicyName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BlobInventoryPolicyName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobInventoryPolicyName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.Completer.cs b/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.Completer.cs new file mode 100644 index 000000000000..8675b4b731d4 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.Completer.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatusTypeConverter))] + public partial struct BlobRestoreProgressStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Complete".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Complete'", "Complete", global::System.Management.Automation.CompletionResultType.ParameterValue, "Complete"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.TypeConverter.cs new file mode 100644 index 000000000000..a93841807a11 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + public partial class BlobRestoreProgressStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BlobRestoreProgressStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.cs b/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.cs new file mode 100644 index 000000000000..63e52843659c --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobRestoreProgressStatus.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The status of blob restore progress. Possible values are: - InProgress: Indicates that blob restore is ongoing. - Complete: + /// Indicates that blob restore has been completed successfully. - Failed: Indicates that blob restore is failed. + /// + public partial struct BlobRestoreProgressStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus Complete = @"Complete"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus InProgress = @"InProgress"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private BlobRestoreProgressStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BlobRestoreProgressStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BlobRestoreProgressStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BlobRestoreProgressStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BlobRestoreProgressStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BlobRestoreProgressStatus && Equals((BlobRestoreProgressStatus)obj); + } + + /// Returns hashCode for enum BlobRestoreProgressStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BlobRestoreProgressStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BlobRestoreProgressStatus + /// the value to convert to an instance of . + + public static implicit operator BlobRestoreProgressStatus(string value) + { + return new BlobRestoreProgressStatus(value); + } + + /// Implicit operator to convert BlobRestoreProgressStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus e) + { + return e._value; + } + + /// Overriding != operator for enum BlobRestoreProgressStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BlobRestoreProgressStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobRestoreProgressStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobServicesName.Completer.cs b/swaggerci/storage/generated/api/Support/BlobServicesName.Completer.cs new file mode 100644 index 000000000000..635c63d98528 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobServicesName.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for BlobServicesName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesNameTypeConverter))] + public partial struct BlobServicesName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'default'", "default", global::System.Management.Automation.CompletionResultType.ParameterValue, "default"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobServicesName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/BlobServicesName.TypeConverter.cs new file mode 100644 index 000000000000..0e28b1d738ba --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobServicesName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for BlobServicesName. + public partial class BlobServicesNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => BlobServicesName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/BlobServicesName.cs b/swaggerci/storage/generated/api/Support/BlobServicesName.cs new file mode 100644 index 000000000000..a41189d66a57 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/BlobServicesName.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct BlobServicesName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private BlobServicesName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to BlobServicesName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new BlobServicesName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type BlobServicesName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type BlobServicesName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is BlobServicesName && Equals((BlobServicesName)obj); + } + + /// Returns hashCode for enum BlobServicesName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for BlobServicesName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to BlobServicesName + /// the value to convert to an instance of . + + public static implicit operator BlobServicesName(string value) + { + return new BlobServicesName(value); + } + + /// Implicit operator to convert BlobServicesName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName e) + { + return e._value; + } + + /// Overriding != operator for enum BlobServicesName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum BlobServicesName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BlobServicesName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Bypass.Completer.cs b/swaggerci/storage/generated/api/Support/Bypass.Completer.cs new file mode 100644 index 000000000000..2c0447b0769a --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Bypass.Completer.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.BypassTypeConverter))] + public partial struct Bypass : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Logging".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Logging'", "Logging", global::System.Management.Automation.CompletionResultType.ParameterValue, "Logging"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Metrics".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Metrics'", "Metrics", global::System.Management.Automation.CompletionResultType.ParameterValue, "Metrics"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureServices".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureServices'", "AzureServices", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureServices"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Bypass.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Bypass.TypeConverter.cs new file mode 100644 index 000000000000..b5383a082a9b --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Bypass.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + public partial class BypassTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Bypass.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Bypass.cs b/swaggerci/storage/generated/api/Support/Bypass.cs new file mode 100644 index 000000000000..707fbb5330a2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Bypass.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + public partial struct Bypass : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass AzureServices = @"AzureServices"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass Logging = @"Logging"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass Metrics = @"Metrics"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Bypass(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Conversion from arbitrary object to Bypass + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Bypass(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Bypass + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Bypass (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Bypass && Equals((Bypass)obj); + } + + /// Returns hashCode for enum Bypass + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Bypass + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Bypass + /// the value to convert to an instance of . + + public static implicit operator Bypass(string value) + { + return new Bypass(value); + } + + /// Implicit operator to convert Bypass to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass e) + { + return e._value; + } + + /// Overriding != operator for enum Bypass + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Bypass + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/CreatedByType.Completer.cs b/swaggerci/storage/generated/api/Support/CreatedByType.Completer.cs new file mode 100644 index 000000000000..4f25f724b0a5 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/CreatedByType.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The type of identity that created the resource. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByTypeTypeConverter))] + public partial struct CreatedByType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "User".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'User'", "User", global::System.Management.Automation.CompletionResultType.ParameterValue, "User"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Application".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Application'", "Application", global::System.Management.Automation.CompletionResultType.ParameterValue, "Application"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ManagedIdentity".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ManagedIdentity'", "ManagedIdentity", global::System.Management.Automation.CompletionResultType.ParameterValue, "ManagedIdentity"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Key".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Key'", "Key", global::System.Management.Automation.CompletionResultType.ParameterValue, "Key"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/CreatedByType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/CreatedByType.TypeConverter.cs new file mode 100644 index 000000000000..57ab1f2c3c3a --- /dev/null +++ b/swaggerci/storage/generated/api/Support/CreatedByType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The type of identity that created the resource. + public partial class CreatedByTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => CreatedByType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/CreatedByType.cs b/swaggerci/storage/generated/api/Support/CreatedByType.cs new file mode 100644 index 000000000000..8471f5137372 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/CreatedByType.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The type of identity that created the resource. + public partial struct CreatedByType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType Application = @"Application"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType Key = @"Key"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType ManagedIdentity = @"ManagedIdentity"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType User = @"User"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to CreatedByType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new CreatedByType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private CreatedByType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type CreatedByType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type CreatedByType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is CreatedByType && Equals((CreatedByType)obj); + } + + /// Returns hashCode for enum CreatedByType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for CreatedByType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to CreatedByType + /// the value to convert to an instance of . + + public static implicit operator CreatedByType(string value) + { + return new CreatedByType(value); + } + + /// Implicit operator to convert CreatedByType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType e) + { + return e._value; + } + + /// Overriding != operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum CreatedByType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.CreatedByType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DefaultAction.Completer.cs b/swaggerci/storage/generated/api/Support/DefaultAction.Completer.cs new file mode 100644 index 000000000000..83bb7a6abd00 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DefaultAction.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the default action of allow or deny when no other rules match. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultActionTypeConverter))] + public partial struct DefaultAction : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Allow".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Allow'", "Allow", global::System.Management.Automation.CompletionResultType.ParameterValue, "Allow"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deny".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deny'", "Deny", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deny"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DefaultAction.TypeConverter.cs b/swaggerci/storage/generated/api/Support/DefaultAction.TypeConverter.cs new file mode 100644 index 000000000000..892b71682232 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DefaultAction.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the default action of allow or deny when no other rules match. + public partial class DefaultActionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DefaultAction.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DefaultAction.cs b/swaggerci/storage/generated/api/Support/DefaultAction.cs new file mode 100644 index 000000000000..cc076ba0acb5 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DefaultAction.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the default action of allow or deny when no other rules match. + public partial struct DefaultAction : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction Allow = @"Allow"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction Deny = @"Deny"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DefaultAction + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DefaultAction(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DefaultAction(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DefaultAction + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DefaultAction (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DefaultAction && Equals((DefaultAction)obj); + } + + /// Returns hashCode for enum DefaultAction + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DefaultAction + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DefaultAction + /// the value to convert to an instance of . + + public static implicit operator DefaultAction(string value) + { + return new DefaultAction(value); + } + + /// Implicit operator to convert DefaultAction to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction e) + { + return e._value; + } + + /// Overriding != operator for enum DefaultAction + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DefaultAction + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DefaultSharePermission.Completer.cs b/swaggerci/storage/generated/api/Support/DefaultSharePermission.Completer.cs new file mode 100644 index 000000000000..de34ac39e98f --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DefaultSharePermission.Completer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermissionTypeConverter))] + public partial struct DefaultSharePermission : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StorageFileDataSmbShareReader".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StorageFileDataSmbShareReader'", "StorageFileDataSmbShareReader", global::System.Management.Automation.CompletionResultType.ParameterValue, "StorageFileDataSmbShareReader"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StorageFileDataSmbShareContributor".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StorageFileDataSmbShareContributor'", "StorageFileDataSmbShareContributor", global::System.Management.Automation.CompletionResultType.ParameterValue, "StorageFileDataSmbShareContributor"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StorageFileDataSmbShareElevatedContributor".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StorageFileDataSmbShareElevatedContributor'", "StorageFileDataSmbShareElevatedContributor", global::System.Management.Automation.CompletionResultType.ParameterValue, "StorageFileDataSmbShareElevatedContributor"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DefaultSharePermission.TypeConverter.cs b/swaggerci/storage/generated/api/Support/DefaultSharePermission.TypeConverter.cs new file mode 100644 index 000000000000..5589dafa17a9 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DefaultSharePermission.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + public partial class DefaultSharePermissionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DefaultSharePermission.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DefaultSharePermission.cs b/swaggerci/storage/generated/api/Support/DefaultSharePermission.cs new file mode 100644 index 000000000000..0b0c24d66d29 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DefaultSharePermission.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + public partial struct DefaultSharePermission : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission StorageFileDataSmbShareContributor = @"StorageFileDataSmbShareContributor"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission StorageFileDataSmbShareElevatedContributor = @"StorageFileDataSmbShareElevatedContributor"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission StorageFileDataSmbShareReader = @"StorageFileDataSmbShareReader"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DefaultSharePermission + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DefaultSharePermission(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DefaultSharePermission(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DefaultSharePermission + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DefaultSharePermission (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DefaultSharePermission && Equals((DefaultSharePermission)obj); + } + + /// Returns hashCode for enum DefaultSharePermission + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DefaultSharePermission + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DefaultSharePermission + /// the value to convert to an instance of . + + public static implicit operator DefaultSharePermission(string value) + { + return new DefaultSharePermission(value); + } + + /// Implicit operator to convert DefaultSharePermission to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission e) + { + return e._value; + } + + /// Overriding != operator for enum DefaultSharePermission + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DefaultSharePermission + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.Completer.cs b/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.Completer.cs new file mode 100644 index 000000000000..17a4d1398c4d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.Completer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptionsTypeConverter))] + public partial struct DirectoryServiceOptions : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AADDS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AADDS'", "AADDS", global::System.Management.Automation.CompletionResultType.ParameterValue, "AADDS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AD".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AD'", "AD", global::System.Management.Automation.CompletionResultType.ParameterValue, "AD"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AADKERB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AADKERB'", "AADKERB", global::System.Management.Automation.CompletionResultType.ParameterValue, "AADKERB"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.TypeConverter.cs b/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.TypeConverter.cs new file mode 100644 index 000000000000..0808fc070dde --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + public partial class DirectoryServiceOptionsTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DirectoryServiceOptions.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.cs b/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.cs new file mode 100644 index 000000000000..57673bca9548 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DirectoryServiceOptions.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + public partial struct DirectoryServiceOptions : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions Aadds = @"AADDS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions Aadkerb = @"AADKERB"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions Ad = @"AD"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DirectoryServiceOptions + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DirectoryServiceOptions(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DirectoryServiceOptions(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DirectoryServiceOptions + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DirectoryServiceOptions (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DirectoryServiceOptions && Equals((DirectoryServiceOptions)obj); + } + + /// Returns hashCode for enum DirectoryServiceOptions + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DirectoryServiceOptions + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DirectoryServiceOptions + /// the value to convert to an instance of . + + public static implicit operator DirectoryServiceOptions(string value) + { + return new DirectoryServiceOptions(value); + } + + /// Implicit operator to convert DirectoryServiceOptions to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions e) + { + return e._value; + } + + /// Overriding != operator for enum DirectoryServiceOptions + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DirectoryServiceOptions + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DnsEndpointType.Completer.cs b/swaggerci/storage/generated/api/Support/DnsEndpointType.Completer.cs new file mode 100644 index 000000000000..919258456e63 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DnsEndpointType.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointTypeTypeConverter))] + public partial struct DnsEndpointType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard'", "Standard", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AzureDnsZone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AzureDnsZone'", "AzureDnsZone", global::System.Management.Automation.CompletionResultType.ParameterValue, "AzureDnsZone"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DnsEndpointType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/DnsEndpointType.TypeConverter.cs new file mode 100644 index 000000000000..78c5cb06cdd8 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DnsEndpointType.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + public partial class DnsEndpointTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => DnsEndpointType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/DnsEndpointType.cs b/swaggerci/storage/generated/api/Support/DnsEndpointType.cs new file mode 100644 index 000000000000..90e379fa982c --- /dev/null +++ b/swaggerci/storage/generated/api/Support/DnsEndpointType.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + public partial struct DnsEndpointType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType AzureDnsZone = @"AzureDnsZone"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType Standard = @"Standard"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to DnsEndpointType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new DnsEndpointType(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private DnsEndpointType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type DnsEndpointType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type DnsEndpointType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is DnsEndpointType && Equals((DnsEndpointType)obj); + } + + /// Returns hashCode for enum DnsEndpointType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for DnsEndpointType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to DnsEndpointType + /// the value to convert to an instance of . + + public static implicit operator DnsEndpointType(string value) + { + return new DnsEndpointType(value); + } + + /// Implicit operator to convert DnsEndpointType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType e) + { + return e._value; + } + + /// Overriding != operator for enum DnsEndpointType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum DnsEndpointType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EnabledProtocols.Completer.cs b/swaggerci/storage/generated/api/Support/EnabledProtocols.Completer.cs new file mode 100644 index 000000000000..9956d84563d5 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EnabledProtocols.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocolsTypeConverter))] + public partial struct EnabledProtocols : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SMB".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SMB'", "SMB", global::System.Management.Automation.CompletionResultType.ParameterValue, "SMB"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NFS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NFS'", "NFS", global::System.Management.Automation.CompletionResultType.ParameterValue, "NFS"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EnabledProtocols.TypeConverter.cs b/swaggerci/storage/generated/api/Support/EnabledProtocols.TypeConverter.cs new file mode 100644 index 000000000000..77da22c4f2cd --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EnabledProtocols.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + public partial class EnabledProtocolsTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EnabledProtocols.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EnabledProtocols.cs b/swaggerci/storage/generated/api/Support/EnabledProtocols.cs new file mode 100644 index 000000000000..14846c0a26aa --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EnabledProtocols.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + public partial struct EnabledProtocols : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols Nfs = @"NFS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols Smb = @"SMB"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EnabledProtocols + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EnabledProtocols(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private EnabledProtocols(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EnabledProtocols + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EnabledProtocols (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EnabledProtocols && Equals((EnabledProtocols)obj); + } + + /// Returns hashCode for enum EnabledProtocols + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EnabledProtocols + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EnabledProtocols + /// the value to convert to an instance of . + + public static implicit operator EnabledProtocols(string value) + { + return new EnabledProtocols(value); + } + + /// Implicit operator to convert EnabledProtocols to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols e) + { + return e._value; + } + + /// Overriding != operator for enum EnabledProtocols + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EnabledProtocols + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EncryptionScopeSource.Completer.cs b/swaggerci/storage/generated/api/Support/EncryptionScopeSource.Completer.cs new file mode 100644 index 000000000000..139b3f6bbed0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EncryptionScopeSource.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSourceTypeConverter))] + public partial struct EncryptionScopeSource : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Microsoft.Storage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Microsoft.Storage'", "Microsoft.Storage", global::System.Management.Automation.CompletionResultType.ParameterValue, "Microsoft.Storage"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Microsoft.KeyVault".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Microsoft.KeyVault'", "Microsoft.KeyVault", global::System.Management.Automation.CompletionResultType.ParameterValue, "Microsoft.KeyVault"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EncryptionScopeSource.TypeConverter.cs b/swaggerci/storage/generated/api/Support/EncryptionScopeSource.TypeConverter.cs new file mode 100644 index 000000000000..e7ebbe5e83e1 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EncryptionScopeSource.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + public partial class EncryptionScopeSourceTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EncryptionScopeSource.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EncryptionScopeSource.cs b/swaggerci/storage/generated/api/Support/EncryptionScopeSource.cs new file mode 100644 index 000000000000..d370f48455e4 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EncryptionScopeSource.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + public partial struct EncryptionScopeSource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource MicrosoftKeyVault = @"Microsoft.KeyVault"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource MicrosoftStorage = @"Microsoft.Storage"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EncryptionScopeSource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EncryptionScopeSource(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private EncryptionScopeSource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EncryptionScopeSource + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EncryptionScopeSource (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EncryptionScopeSource && Equals((EncryptionScopeSource)obj); + } + + /// Returns hashCode for enum EncryptionScopeSource + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EncryptionScopeSource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EncryptionScopeSource + /// the value to convert to an instance of . + + public static implicit operator EncryptionScopeSource(string value) + { + return new EncryptionScopeSource(value); + } + + /// Implicit operator to convert EncryptionScopeSource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource e) + { + return e._value; + } + + /// Overriding != operator for enum EncryptionScopeSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EncryptionScopeSource + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EncryptionScopeState.Completer.cs b/swaggerci/storage/generated/api/Support/EncryptionScopeState.Completer.cs new file mode 100644 index 000000000000..1f158cee86ff --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EncryptionScopeState.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeStateTypeConverter))] + public partial struct EncryptionScopeState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EncryptionScopeState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/EncryptionScopeState.TypeConverter.cs new file mode 100644 index 000000000000..16606ad3ff77 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EncryptionScopeState.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + public partial class EncryptionScopeStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => EncryptionScopeState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/EncryptionScopeState.cs b/swaggerci/storage/generated/api/Support/EncryptionScopeState.cs new file mode 100644 index 000000000000..b7d40fadf4c8 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/EncryptionScopeState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + public partial struct EncryptionScopeState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to EncryptionScopeState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new EncryptionScopeState(global::System.Convert.ToString(value)); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private EncryptionScopeState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Compares values of enum type EncryptionScopeState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type EncryptionScopeState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is EncryptionScopeState && Equals((EncryptionScopeState)obj); + } + + /// Returns hashCode for enum EncryptionScopeState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for EncryptionScopeState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to EncryptionScopeState + /// the value to convert to an instance of . + + public static implicit operator EncryptionScopeState(string value) + { + return new EncryptionScopeState(value); + } + + /// Implicit operator to convert EncryptionScopeState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState e) + { + return e._value; + } + + /// Overriding != operator for enum EncryptionScopeState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum EncryptionScopeState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.Completer.cs b/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.Completer.cs new file mode 100644 index 000000000000..a10c2d548333 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The type of extendedLocation. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypesTypeConverter))] + public partial struct ExtendedLocationTypes : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "EdgeZone".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'EdgeZone'", "EdgeZone", global::System.Management.Automation.CompletionResultType.ParameterValue, "EdgeZone"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs new file mode 100644 index 000000000000..5b2aaf349545 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The type of extendedLocation. + public partial class ExtendedLocationTypesTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ExtendedLocationTypes.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.cs b/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.cs new file mode 100644 index 000000000000..3e3373430fda --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ExtendedLocationTypes.cs @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The type of extendedLocation. + public partial struct ExtendedLocationTypes : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes EdgeZone = @"EdgeZone"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ExtendedLocationTypes + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ExtendedLocationTypes(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ExtendedLocationTypes + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ExtendedLocationTypes (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ExtendedLocationTypes && Equals((ExtendedLocationTypes)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ExtendedLocationTypes(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum ExtendedLocationTypes + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for ExtendedLocationTypes + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ExtendedLocationTypes + /// the value to convert to an instance of . + + public static implicit operator ExtendedLocationTypes(string value) + { + return new ExtendedLocationTypes(value); + } + + /// Implicit operator to convert ExtendedLocationTypes to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes e) + { + return e._value; + } + + /// Overriding != operator for enum ExtendedLocationTypes + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ExtendedLocationTypes + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/FileServicesName.Completer.cs b/swaggerci/storage/generated/api/Support/FileServicesName.Completer.cs new file mode 100644 index 000000000000..20bd4cf90f64 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/FileServicesName.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for FileServicesName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesNameTypeConverter))] + public partial struct FileServicesName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'default'", "default", global::System.Management.Automation.CompletionResultType.ParameterValue, "default"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/FileServicesName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/FileServicesName.TypeConverter.cs new file mode 100644 index 000000000000..78649607d093 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/FileServicesName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for FileServicesName. + public partial class FileServicesNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => FileServicesName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/FileServicesName.cs b/swaggerci/storage/generated/api/Support/FileServicesName.cs new file mode 100644 index 000000000000..0f52e781f306 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/FileServicesName.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct FileServicesName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to FileServicesName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new FileServicesName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type FileServicesName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type FileServicesName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is FileServicesName && Equals((FileServicesName)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private FileServicesName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum FileServicesName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for FileServicesName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to FileServicesName + /// the value to convert to an instance of . + + public static implicit operator FileServicesName(string value) + { + return new FileServicesName(value); + } + + /// Implicit operator to convert FileServicesName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName e) + { + return e._value; + } + + /// Overriding != operator for enum FileServicesName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum FileServicesName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FileServicesName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Format.Completer.cs b/swaggerci/storage/generated/api/Support/Format.Completer.cs new file mode 100644 index 000000000000..eb0cec980c89 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Format.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// This is a required field, it specifies the format for the inventory files. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.FormatTypeConverter))] + public partial struct Format : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Csv".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Csv'", "Csv", global::System.Management.Automation.CompletionResultType.ParameterValue, "Csv"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Parquet".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Parquet'", "Parquet", global::System.Management.Automation.CompletionResultType.ParameterValue, "Parquet"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Format.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Format.TypeConverter.cs new file mode 100644 index 000000000000..92e555659848 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Format.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// This is a required field, it specifies the format for the inventory files. + public partial class FormatTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Format.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Format.cs b/swaggerci/storage/generated/api/Support/Format.cs new file mode 100644 index 000000000000..36bf9763b0b2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Format.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// This is a required field, it specifies the format for the inventory files. + public partial struct Format : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format Csv = @"Csv"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format Parquet = @"Parquet"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Format + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Format(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Format + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Format (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Format && Equals((Format)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Format(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum Format + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for Format + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Format + /// the value to convert to an instance of . + + public static implicit operator Format(string value) + { + return new Format(value); + } + + /// Implicit operator to convert Format to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format e) + { + return e._value; + } + + /// Overriding != operator for enum Format + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Format + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Format e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/GeoReplicationStatus.Completer.cs b/swaggerci/storage/generated/api/Support/GeoReplicationStatus.Completer.cs new file mode 100644 index 000000000000..ab3a081fa745 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/GeoReplicationStatus.Completer.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatusTypeConverter))] + public partial struct GeoReplicationStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Live".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Live'", "Live", global::System.Management.Automation.CompletionResultType.ParameterValue, "Live"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Bootstrap".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Bootstrap'", "Bootstrap", global::System.Management.Automation.CompletionResultType.ParameterValue, "Bootstrap"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unavailable".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unavailable'", "Unavailable", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unavailable"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/GeoReplicationStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Support/GeoReplicationStatus.TypeConverter.cs new file mode 100644 index 000000000000..d1fa32249a6d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/GeoReplicationStatus.TypeConverter.cs @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + public partial class GeoReplicationStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => GeoReplicationStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/GeoReplicationStatus.cs b/swaggerci/storage/generated/api/Support/GeoReplicationStatus.cs new file mode 100644 index 000000000000..3b668806ca49 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/GeoReplicationStatus.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The status of the secondary location. Possible values are: - Live: Indicates that the secondary location is active and + /// operational. - Bootstrap: Indicates initial synchronization from the primary location to the secondary location is in + /// progress.This typically occurs when replication is first enabled. - Unavailable: Indicates that the secondary location + /// is temporarily unavailable. + /// + public partial struct GeoReplicationStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus Bootstrap = @"Bootstrap"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus Live = @"Live"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus Unavailable = @"Unavailable"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to GeoReplicationStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new GeoReplicationStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type GeoReplicationStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type GeoReplicationStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is GeoReplicationStatus && Equals((GeoReplicationStatus)obj); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private GeoReplicationStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns hashCode for enum GeoReplicationStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for GeoReplicationStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to GeoReplicationStatus + /// the value to convert to an instance of . + + public static implicit operator GeoReplicationStatus(string value) + { + return new GeoReplicationStatus(value); + } + + /// Implicit operator to convert GeoReplicationStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus e) + { + return e._value; + } + + /// Overriding != operator for enum GeoReplicationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum GeoReplicationStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.GeoReplicationStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/HttpProtocol.Completer.cs b/swaggerci/storage/generated/api/Support/HttpProtocol.Completer.cs new file mode 100644 index 000000000000..c22950e5cb34 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/HttpProtocol.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The protocol permitted for a request made with the account SAS. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocolTypeConverter))] + public partial struct HttpProtocol : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "https,http".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'https,http'", "https,http", global::System.Management.Automation.CompletionResultType.ParameterValue, "https,http"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "https".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'https'", "https", global::System.Management.Automation.CompletionResultType.ParameterValue, "https"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/HttpProtocol.TypeConverter.cs b/swaggerci/storage/generated/api/Support/HttpProtocol.TypeConverter.cs new file mode 100644 index 000000000000..2db4b8604a78 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/HttpProtocol.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The protocol permitted for a request made with the account SAS. + public partial class HttpProtocolTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => HttpProtocol.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/HttpProtocol.cs b/swaggerci/storage/generated/api/Support/HttpProtocol.cs new file mode 100644 index 000000000000..528619d42815 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/HttpProtocol.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The protocol permitted for a request made with the account SAS. + public partial struct HttpProtocol : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol Https = @"https"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol HttpsHttp = @"https,http"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to HttpProtocol + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new HttpProtocol(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type HttpProtocol + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type HttpProtocol (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is HttpProtocol && Equals((HttpProtocol)obj); + } + + /// Returns hashCode for enum HttpProtocol + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private HttpProtocol(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for HttpProtocol + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to HttpProtocol + /// the value to convert to an instance of . + + public static implicit operator HttpProtocol(string value) + { + return new HttpProtocol(value); + } + + /// Implicit operator to convert HttpProtocol to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol e) + { + return e._value; + } + + /// Overriding != operator for enum HttpProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum HttpProtocol + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/IdentityType.Completer.cs b/swaggerci/storage/generated/api/Support/IdentityType.Completer.cs new file mode 100644 index 000000000000..917a1d8041e3 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/IdentityType.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The identity type. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityTypeTypeConverter))] + public partial struct IdentityType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned'", "SystemAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'UserAssigned'", "UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "UserAssigned"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "SystemAssigned,UserAssigned".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'SystemAssigned,UserAssigned'", "SystemAssigned,UserAssigned", global::System.Management.Automation.CompletionResultType.ParameterValue, "SystemAssigned,UserAssigned"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/IdentityType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/IdentityType.TypeConverter.cs new file mode 100644 index 000000000000..d3abf6aca750 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/IdentityType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The identity type. + public partial class IdentityTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => IdentityType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/IdentityType.cs b/swaggerci/storage/generated/api/Support/IdentityType.cs new file mode 100644 index 000000000000..41f93c7d9279 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/IdentityType.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The identity type. + public partial struct IdentityType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType None = @"None"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType SystemAssigned = @"SystemAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType SystemAssignedUserAssigned = @"SystemAssigned,UserAssigned"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType UserAssigned = @"UserAssigned"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to IdentityType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new IdentityType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type IdentityType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type IdentityType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is IdentityType && Equals((IdentityType)obj); + } + + /// Returns hashCode for enum IdentityType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private IdentityType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for IdentityType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to IdentityType + /// the value to convert to an instance of . + + public static implicit operator IdentityType(string value) + { + return new IdentityType(value); + } + + /// Implicit operator to convert IdentityType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType e) + { + return e._value; + } + + /// Overriding != operator for enum IdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum IdentityType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.Completer.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.Completer.cs new file mode 100644 index 000000000000..cc206c5e6717 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for ImmutabilityPolicyName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyNameTypeConverter))] + public partial struct ImmutabilityPolicyName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'default'", "default", global::System.Management.Automation.CompletionResultType.ParameterValue, "default"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.TypeConverter.cs new file mode 100644 index 000000000000..c07e7fcf0acb --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for ImmutabilityPolicyName. + public partial class ImmutabilityPolicyNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ImmutabilityPolicyName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.cs new file mode 100644 index 000000000000..1d8e4247cd49 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyName.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct ImmutabilityPolicyName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ImmutabilityPolicyName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ImmutabilityPolicyName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ImmutabilityPolicyName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ImmutabilityPolicyName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ImmutabilityPolicyName && Equals((ImmutabilityPolicyName)obj); + } + + /// Returns hashCode for enum ImmutabilityPolicyName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ImmutabilityPolicyName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ImmutabilityPolicyName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ImmutabilityPolicyName + /// the value to convert to an instance of . + + public static implicit operator ImmutabilityPolicyName(string value) + { + return new ImmutabilityPolicyName(value); + } + + /// Implicit operator to convert ImmutabilityPolicyName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName e) + { + return e._value; + } + + /// Overriding != operator for enum ImmutabilityPolicyName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ImmutabilityPolicyName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.Completer.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.Completer.cs new file mode 100644 index 000000000000..50c1036ba899 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyStateTypeConverter))] + public partial struct ImmutabilityPolicyState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Locked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Locked'", "Locked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Locked"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unlocked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unlocked'", "Unlocked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unlocked"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.TypeConverter.cs new file mode 100644 index 000000000000..2c9c1b2d5997 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + public partial class ImmutabilityPolicyStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ImmutabilityPolicyState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.cs new file mode 100644 index 000000000000..39d275d5ff93 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy state of a blob container, possible values include: Locked and Unlocked. + /// + public partial struct ImmutabilityPolicyState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState Locked = @"Locked"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState Unlocked = @"Unlocked"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ImmutabilityPolicyState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ImmutabilityPolicyState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ImmutabilityPolicyState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ImmutabilityPolicyState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ImmutabilityPolicyState && Equals((ImmutabilityPolicyState)obj); + } + + /// Returns hashCode for enum ImmutabilityPolicyState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ImmutabilityPolicyState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ImmutabilityPolicyState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ImmutabilityPolicyState + /// the value to convert to an instance of . + + public static implicit operator ImmutabilityPolicyState(string value) + { + return new ImmutabilityPolicyState(value); + } + + /// Implicit operator to convert ImmutabilityPolicyState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState e) + { + return e._value; + } + + /// Overriding != operator for enum ImmutabilityPolicyState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ImmutabilityPolicyState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.Completer.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.Completer.cs new file mode 100644 index 000000000000..5077d1411f30 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.Completer.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateTypeTypeConverter))] + public partial struct ImmutabilityPolicyUpdateType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "put".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'put'", "put", global::System.Management.Automation.CompletionResultType.ParameterValue, "put"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "lock".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'lock'", "lock", global::System.Management.Automation.CompletionResultType.ParameterValue, "lock"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "extend".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'extend'", "extend", global::System.Management.Automation.CompletionResultType.ParameterValue, "extend"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.TypeConverter.cs new file mode 100644 index 000000000000..55694b9d60f7 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + /// + public partial class ImmutabilityPolicyUpdateTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ImmutabilityPolicyUpdateType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.cs b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.cs new file mode 100644 index 000000000000..0ab22ea2d0fa --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ImmutabilityPolicyUpdateType.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The ImmutabilityPolicy update type of a blob container, possible values include: put, lock and extend. + /// + public partial struct ImmutabilityPolicyUpdateType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType Extend = @"extend"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType Lock = @"lock"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType Put = @"put"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to ImmutabilityPolicyUpdateType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ImmutabilityPolicyUpdateType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ImmutabilityPolicyUpdateType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ImmutabilityPolicyUpdateType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ImmutabilityPolicyUpdateType && Equals((ImmutabilityPolicyUpdateType)obj); + } + + /// Returns hashCode for enum ImmutabilityPolicyUpdateType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private ImmutabilityPolicyUpdateType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ImmutabilityPolicyUpdateType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ImmutabilityPolicyUpdateType + /// the value to convert to an instance of . + + public static implicit operator ImmutabilityPolicyUpdateType(string value) + { + return new ImmutabilityPolicyUpdateType(value); + } + + /// Implicit operator to convert ImmutabilityPolicyUpdateType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType e) + { + return e._value; + } + + /// Overriding != operator for enum ImmutabilityPolicyUpdateType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ImmutabilityPolicyUpdateType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ImmutabilityPolicyUpdateType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeyPermission.Completer.cs b/swaggerci/storage/generated/api/Support/KeyPermission.Completer.cs new file mode 100644 index 000000000000..aac16fe4893a --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeyPermission.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Permissions for the key -- read-only or full permissions. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermissionTypeConverter))] + public partial struct KeyPermission : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Read".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Read'", "Read", global::System.Management.Automation.CompletionResultType.ParameterValue, "Read"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Full".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Full'", "Full", global::System.Management.Automation.CompletionResultType.ParameterValue, "Full"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeyPermission.TypeConverter.cs b/swaggerci/storage/generated/api/Support/KeyPermission.TypeConverter.cs new file mode 100644 index 000000000000..dc4cb58a1bfc --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeyPermission.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Permissions for the key -- read-only or full permissions. + public partial class KeyPermissionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => KeyPermission.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeyPermission.cs b/swaggerci/storage/generated/api/Support/KeyPermission.cs new file mode 100644 index 000000000000..985ccc398672 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeyPermission.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Permissions for the key -- read-only or full permissions. + public partial struct KeyPermission : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission Full = @"Full"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission Read = @"Read"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KeyPermission + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeyPermission(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeyPermission + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeyPermission (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is KeyPermission && Equals((KeyPermission)obj); + } + + /// Returns hashCode for enum KeyPermission + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private KeyPermission(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeyPermission + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeyPermission + /// the value to convert to an instance of . + + public static implicit operator KeyPermission(string value) + { + return new KeyPermission(value); + } + + /// Implicit operator to convert KeyPermission to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission e) + { + return e._value; + } + + /// Overriding != operator for enum KeyPermission + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeyPermission + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyPermission e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeySource.Completer.cs b/swaggerci/storage/generated/api/Support/KeySource.Completer.cs new file mode 100644 index 000000000000..27e2e4803f09 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeySource.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySourceTypeConverter))] + public partial struct KeySource : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Microsoft.Storage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Microsoft.Storage'", "Microsoft.Storage", global::System.Management.Automation.CompletionResultType.ParameterValue, "Microsoft.Storage"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Microsoft.Keyvault".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Microsoft.Keyvault'", "Microsoft.Keyvault", global::System.Management.Automation.CompletionResultType.ParameterValue, "Microsoft.Keyvault"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeySource.TypeConverter.cs b/swaggerci/storage/generated/api/Support/KeySource.TypeConverter.cs new file mode 100644 index 000000000000..b710a0c33ac1 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeySource.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + /// + public partial class KeySourceTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => KeySource.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeySource.cs b/swaggerci/storage/generated/api/Support/KeySource.cs new file mode 100644 index 000000000000..c3abb289705b --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeySource.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault + /// + public partial struct KeySource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource MicrosoftKeyvault = @"Microsoft.Keyvault"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource MicrosoftStorage = @"Microsoft.Storage"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KeySource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeySource(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeySource + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeySource (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is KeySource && Equals((KeySource)obj); + } + + /// Returns hashCode for enum KeySource + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private KeySource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeySource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeySource + /// the value to convert to an instance of . + + public static implicit operator KeySource(string value) + { + return new KeySource(value); + } + + /// Implicit operator to convert KeySource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource e) + { + return e._value; + } + + /// Overriding != operator for enum KeySource + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeySource + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeySource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeyType.Completer.cs b/swaggerci/storage/generated/api/Support/KeyType.Completer.cs new file mode 100644 index 000000000000..1d8c69006076 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeyType.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyTypeTypeConverter))] + public partial struct KeyType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Service".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Service'", "Service", global::System.Management.Automation.CompletionResultType.ParameterValue, "Service"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Account".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Account'", "Account", global::System.Management.Automation.CompletionResultType.ParameterValue, "Account"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeyType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/KeyType.TypeConverter.cs new file mode 100644 index 000000000000..c64167bfcd8e --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeyType.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + public partial class KeyTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => KeyType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/KeyType.cs b/swaggerci/storage/generated/api/Support/KeyType.cs new file mode 100644 index 000000000000..aa51d819b588 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/KeyType.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Encryption key type to be used for the encryption service. 'Account' key type implies that an account-scoped encryption + /// key will be used. 'Service' key type implies that a default service key is used. + /// + public partial struct KeyType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType Account = @"Account"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType Service = @"Service"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to KeyType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new KeyType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type KeyType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type KeyType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is KeyType && Equals((KeyType)obj); + } + + /// Returns hashCode for enum KeyType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private KeyType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for KeyType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to KeyType + /// the value to convert to an instance of . + + public static implicit operator KeyType(string value) + { + return new KeyType(value); + } + + /// Implicit operator to convert KeyType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType e) + { + return e._value; + } + + /// Overriding != operator for enum KeyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum KeyType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KeyType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Kind.Completer.cs b/swaggerci/storage/generated/api/Support/Kind.Completer.cs new file mode 100644 index 000000000000..8c8a0dde7670 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Kind.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Indicates the type of storage account. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.KindTypeConverter))] + public partial struct Kind : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Storage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Storage'", "Storage", global::System.Management.Automation.CompletionResultType.ParameterValue, "Storage"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "StorageV2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'StorageV2'", "StorageV2", global::System.Management.Automation.CompletionResultType.ParameterValue, "StorageV2"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BlobStorage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BlobStorage'", "BlobStorage", global::System.Management.Automation.CompletionResultType.ParameterValue, "BlobStorage"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "FileStorage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'FileStorage'", "FileStorage", global::System.Management.Automation.CompletionResultType.ParameterValue, "FileStorage"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BlockBlobStorage".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BlockBlobStorage'", "BlockBlobStorage", global::System.Management.Automation.CompletionResultType.ParameterValue, "BlockBlobStorage"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Kind.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Kind.TypeConverter.cs new file mode 100644 index 000000000000..655ecf18eb67 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Kind.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Indicates the type of storage account. + public partial class KindTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Kind.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Kind.cs b/swaggerci/storage/generated/api/Support/Kind.cs new file mode 100644 index 000000000000..62ad68eeb434 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Kind.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Indicates the type of storage account. + public partial struct Kind : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind BlobStorage = @"BlobStorage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind BlockBlobStorage = @"BlockBlobStorage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind FileStorage = @"FileStorage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind Storage = @"Storage"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind StorageV2 = @"StorageV2"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Kind + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Kind(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Kind + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Kind (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Kind && Equals((Kind)obj); + } + + /// Returns hashCode for enum Kind + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Kind(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Kind + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Kind + /// the value to convert to an instance of . + + public static implicit operator Kind(string value) + { + return new Kind(value); + } + + /// Implicit operator to convert Kind to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind e) + { + return e._value; + } + + /// Overriding != operator for enum Kind + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Kind + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LargeFileSharesState.Completer.cs b/swaggerci/storage/generated/api/Support/LargeFileSharesState.Completer.cs new file mode 100644 index 000000000000..57bd13aabda2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LargeFileSharesState.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesStateTypeConverter))] + public partial struct LargeFileSharesState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LargeFileSharesState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/LargeFileSharesState.TypeConverter.cs new file mode 100644 index 000000000000..c68259b22719 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LargeFileSharesState.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + public partial class LargeFileSharesStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LargeFileSharesState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LargeFileSharesState.cs b/swaggerci/storage/generated/api/Support/LargeFileSharesState.cs new file mode 100644 index 000000000000..6eca0875bdb8 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LargeFileSharesState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + public partial struct LargeFileSharesState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LargeFileSharesState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LargeFileSharesState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LargeFileSharesState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LargeFileSharesState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LargeFileSharesState && Equals((LargeFileSharesState)obj); + } + + /// Returns hashCode for enum LargeFileSharesState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LargeFileSharesState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LargeFileSharesState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LargeFileSharesState + /// the value to convert to an instance of . + + public static implicit operator LargeFileSharesState(string value) + { + return new LargeFileSharesState(value); + } + + /// Implicit operator to convert LargeFileSharesState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState e) + { + return e._value; + } + + /// Overriding != operator for enum LargeFileSharesState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LargeFileSharesState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseContainerRequest.Completer.cs b/swaggerci/storage/generated/api/Support/LeaseContainerRequest.Completer.cs new file mode 100644 index 000000000000..f21872303bab --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseContainerRequest.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the lease action. Can be one of the available actions. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequestTypeConverter))] + public partial struct LeaseContainerRequest : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Acquire".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Acquire'", "Acquire", global::System.Management.Automation.CompletionResultType.ParameterValue, "Acquire"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Renew".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Renew'", "Renew", global::System.Management.Automation.CompletionResultType.ParameterValue, "Renew"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Change".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Change'", "Change", global::System.Management.Automation.CompletionResultType.ParameterValue, "Change"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Release".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Release'", "Release", global::System.Management.Automation.CompletionResultType.ParameterValue, "Release"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Break".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Break'", "Break", global::System.Management.Automation.CompletionResultType.ParameterValue, "Break"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseContainerRequest.TypeConverter.cs b/swaggerci/storage/generated/api/Support/LeaseContainerRequest.TypeConverter.cs new file mode 100644 index 000000000000..42cd9a522a83 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseContainerRequest.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the lease action. Can be one of the available actions. + public partial class LeaseContainerRequestTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LeaseContainerRequest.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseContainerRequest.cs b/swaggerci/storage/generated/api/Support/LeaseContainerRequest.cs new file mode 100644 index 000000000000..8d01b7f68717 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseContainerRequest.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the lease action. Can be one of the available actions. + public partial struct LeaseContainerRequest : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Acquire = @"Acquire"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Break = @"Break"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Change = @"Change"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Release = @"Release"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Renew = @"Renew"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LeaseContainerRequest + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LeaseContainerRequest(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LeaseContainerRequest + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LeaseContainerRequest (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LeaseContainerRequest && Equals((LeaseContainerRequest)obj); + } + + /// Returns hashCode for enum LeaseContainerRequest + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LeaseContainerRequest(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LeaseContainerRequest + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LeaseContainerRequest + /// the value to convert to an instance of . + + public static implicit operator LeaseContainerRequest(string value) + { + return new LeaseContainerRequest(value); + } + + /// Implicit operator to convert LeaseContainerRequest to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest e) + { + return e._value; + } + + /// Overriding != operator for enum LeaseContainerRequest + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LeaseContainerRequest + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseDuration.Completer.cs b/swaggerci/storage/generated/api/Support/LeaseDuration.Completer.cs new file mode 100644 index 000000000000..2ac1a8ea6b89 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseDuration.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDurationTypeConverter))] + public partial struct LeaseDuration : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Infinite".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Infinite'", "Infinite", global::System.Management.Automation.CompletionResultType.ParameterValue, "Infinite"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Fixed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Fixed'", "Fixed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Fixed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseDuration.TypeConverter.cs b/swaggerci/storage/generated/api/Support/LeaseDuration.TypeConverter.cs new file mode 100644 index 000000000000..5015cc8035ae --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseDuration.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + public partial class LeaseDurationTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LeaseDuration.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseDuration.cs b/swaggerci/storage/generated/api/Support/LeaseDuration.cs new file mode 100644 index 000000000000..3b4bbcb57986 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseDuration.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether the lease on a container is of infinite or fixed duration, only when the container is leased. + /// + public partial struct LeaseDuration : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration Fixed = @"Fixed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration Infinite = @"Infinite"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LeaseDuration + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LeaseDuration(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LeaseDuration + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LeaseDuration (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LeaseDuration && Equals((LeaseDuration)obj); + } + + /// Returns hashCode for enum LeaseDuration + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LeaseDuration(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LeaseDuration + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LeaseDuration + /// the value to convert to an instance of . + + public static implicit operator LeaseDuration(string value) + { + return new LeaseDuration(value); + } + + /// Implicit operator to convert LeaseDuration to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration e) + { + return e._value; + } + + /// Overriding != operator for enum LeaseDuration + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LeaseDuration + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseDuration e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseShareAction.Completer.cs b/swaggerci/storage/generated/api/Support/LeaseShareAction.Completer.cs new file mode 100644 index 000000000000..50b13e295813 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseShareAction.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the lease action. Can be one of the available actions. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareActionTypeConverter))] + public partial struct LeaseShareAction : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Acquire".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Acquire'", "Acquire", global::System.Management.Automation.CompletionResultType.ParameterValue, "Acquire"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Renew".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Renew'", "Renew", global::System.Management.Automation.CompletionResultType.ParameterValue, "Renew"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Change".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Change'", "Change", global::System.Management.Automation.CompletionResultType.ParameterValue, "Change"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Release".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Release'", "Release", global::System.Management.Automation.CompletionResultType.ParameterValue, "Release"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Break".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Break'", "Break", global::System.Management.Automation.CompletionResultType.ParameterValue, "Break"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseShareAction.TypeConverter.cs b/swaggerci/storage/generated/api/Support/LeaseShareAction.TypeConverter.cs new file mode 100644 index 000000000000..526f064de637 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseShareAction.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the lease action. Can be one of the available actions. + public partial class LeaseShareActionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LeaseShareAction.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseShareAction.cs b/swaggerci/storage/generated/api/Support/LeaseShareAction.cs new file mode 100644 index 000000000000..9db3f0c599ed --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseShareAction.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Specifies the lease action. Can be one of the available actions. + public partial struct LeaseShareAction : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Acquire = @"Acquire"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Break = @"Break"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Change = @"Change"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Release = @"Release"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Renew = @"Renew"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LeaseShareAction + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LeaseShareAction(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LeaseShareAction + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LeaseShareAction (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LeaseShareAction && Equals((LeaseShareAction)obj); + } + + /// Returns hashCode for enum LeaseShareAction + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LeaseShareAction(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LeaseShareAction + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LeaseShareAction + /// the value to convert to an instance of . + + public static implicit operator LeaseShareAction(string value) + { + return new LeaseShareAction(value); + } + + /// Implicit operator to convert LeaseShareAction to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction e) + { + return e._value; + } + + /// Overriding != operator for enum LeaseShareAction + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LeaseShareAction + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseState.Completer.cs b/swaggerci/storage/generated/api/Support/LeaseState.Completer.cs new file mode 100644 index 000000000000..8cf0bddaa880 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseState.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Lease state of the container. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStateTypeConverter))] + public partial struct LeaseState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Available".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Available'", "Available", global::System.Management.Automation.CompletionResultType.ParameterValue, "Available"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Leased".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Leased'", "Leased", global::System.Management.Automation.CompletionResultType.ParameterValue, "Leased"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Expired".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Expired'", "Expired", global::System.Management.Automation.CompletionResultType.ParameterValue, "Expired"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Breaking".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Breaking'", "Breaking", global::System.Management.Automation.CompletionResultType.ParameterValue, "Breaking"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Broken".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Broken'", "Broken", global::System.Management.Automation.CompletionResultType.ParameterValue, "Broken"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/LeaseState.TypeConverter.cs new file mode 100644 index 000000000000..71824fe5fb80 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Lease state of the container. + public partial class LeaseStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LeaseState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseState.cs b/swaggerci/storage/generated/api/Support/LeaseState.cs new file mode 100644 index 000000000000..354b0b835ee0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseState.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Lease state of the container. + public partial struct LeaseState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState Available = @"Available"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState Breaking = @"Breaking"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState Broken = @"Broken"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState Expired = @"Expired"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState Leased = @"Leased"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LeaseState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LeaseState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LeaseState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LeaseState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LeaseState && Equals((LeaseState)obj); + } + + /// Returns hashCode for enum LeaseState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LeaseState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LeaseState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LeaseState + /// the value to convert to an instance of . + + public static implicit operator LeaseState(string value) + { + return new LeaseState(value); + } + + /// Implicit operator to convert LeaseState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState e) + { + return e._value; + } + + /// Overriding != operator for enum LeaseState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LeaseState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseStatus.Completer.cs b/swaggerci/storage/generated/api/Support/LeaseStatus.Completer.cs new file mode 100644 index 000000000000..24b58c8b37dc --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseStatus.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The lease status of the container. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatusTypeConverter))] + public partial struct LeaseStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Locked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Locked'", "Locked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Locked"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Unlocked".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Unlocked'", "Unlocked", global::System.Management.Automation.CompletionResultType.ParameterValue, "Unlocked"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Support/LeaseStatus.TypeConverter.cs new file mode 100644 index 000000000000..b36e3b504bdf --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The lease status of the container. + public partial class LeaseStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => LeaseStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/LeaseStatus.cs b/swaggerci/storage/generated/api/Support/LeaseStatus.cs new file mode 100644 index 000000000000..db76ea629163 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/LeaseStatus.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The lease status of the container. + public partial struct LeaseStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus Locked = @"Locked"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus Unlocked = @"Unlocked"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to LeaseStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new LeaseStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type LeaseStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type LeaseStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is LeaseStatus && Equals((LeaseStatus)obj); + } + + /// Returns hashCode for enum LeaseStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private LeaseStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for LeaseStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to LeaseStatus + /// the value to convert to an instance of . + + public static implicit operator LeaseStatus(string value) + { + return new LeaseStatus(value); + } + + /// Implicit operator to convert LeaseStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus e) + { + return e._value; + } + + /// Overriding != operator for enum LeaseStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum LeaseStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ListContainersInclude.Completer.cs b/swaggerci/storage/generated/api/Support/ListContainersInclude.Completer.cs new file mode 100644 index 000000000000..10d145a3dff8 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ListContainersInclude.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for ListContainersInclude. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersIncludeTypeConverter))] + public partial struct ListContainersInclude : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "deleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'deleted'", "deleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "deleted"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ListContainersInclude.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ListContainersInclude.TypeConverter.cs new file mode 100644 index 000000000000..85c024eb9316 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ListContainersInclude.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for ListContainersInclude. + public partial class ListContainersIncludeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ListContainersInclude.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ListContainersInclude.cs b/swaggerci/storage/generated/api/Support/ListContainersInclude.cs new file mode 100644 index 000000000000..f5acc3febe84 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ListContainersInclude.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct ListContainersInclude : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude Deleted = @"deleted"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ListContainersInclude + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ListContainersInclude(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ListContainersInclude + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ListContainersInclude (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ListContainersInclude && Equals((ListContainersInclude)obj); + } + + /// Returns hashCode for enum ListContainersInclude + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ListContainersInclude(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ListContainersInclude + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ListContainersInclude + /// the value to convert to an instance of . + + public static implicit operator ListContainersInclude(string value) + { + return new ListContainersInclude(value); + } + + /// Implicit operator to convert ListContainersInclude to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude e) + { + return e._value; + } + + /// Overriding != operator for enum ListContainersInclude + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ListContainersInclude + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ListKeyExpand.Completer.cs b/swaggerci/storage/generated/api/Support/ListKeyExpand.Completer.cs new file mode 100644 index 000000000000..d5c2b12bc73f --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ListKeyExpand.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for ListKeyExpand. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpandTypeConverter))] + public partial struct ListKeyExpand : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "kerb".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'kerb'", "kerb", global::System.Management.Automation.CompletionResultType.ParameterValue, "kerb"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ListKeyExpand.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ListKeyExpand.TypeConverter.cs new file mode 100644 index 000000000000..df399a008ce9 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ListKeyExpand.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for ListKeyExpand. + public partial class ListKeyExpandTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ListKeyExpand.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ListKeyExpand.cs b/swaggerci/storage/generated/api/Support/ListKeyExpand.cs new file mode 100644 index 000000000000..c92428ce431e --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ListKeyExpand.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct ListKeyExpand : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand Kerb = @"kerb"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ListKeyExpand + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ListKeyExpand(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ListKeyExpand + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ListKeyExpand (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ListKeyExpand && Equals((ListKeyExpand)obj); + } + + /// Returns hashCode for enum ListKeyExpand + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ListKeyExpand(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ListKeyExpand + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ListKeyExpand + /// the value to convert to an instance of . + + public static implicit operator ListKeyExpand(string value) + { + return new ListKeyExpand(value); + } + + /// Implicit operator to convert ListKeyExpand to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand e) + { + return e._value; + } + + /// Overriding != operator for enum ListKeyExpand + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ListKeyExpand + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ManagementPolicyName.Completer.cs b/swaggerci/storage/generated/api/Support/ManagementPolicyName.Completer.cs new file mode 100644 index 000000000000..a6feed838914 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ManagementPolicyName.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for ManagementPolicyName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyNameTypeConverter))] + public partial struct ManagementPolicyName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'default'", "default", global::System.Management.Automation.CompletionResultType.ParameterValue, "default"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ManagementPolicyName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ManagementPolicyName.TypeConverter.cs new file mode 100644 index 000000000000..8d9503540caa --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ManagementPolicyName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for ManagementPolicyName. + public partial class ManagementPolicyNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ManagementPolicyName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ManagementPolicyName.cs b/swaggerci/storage/generated/api/Support/ManagementPolicyName.cs new file mode 100644 index 000000000000..570969608a38 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ManagementPolicyName.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct ManagementPolicyName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ManagementPolicyName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ManagementPolicyName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ManagementPolicyName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ManagementPolicyName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ManagementPolicyName && Equals((ManagementPolicyName)obj); + } + + /// Returns hashCode for enum ManagementPolicyName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ManagementPolicyName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ManagementPolicyName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ManagementPolicyName + /// the value to convert to an instance of . + + public static implicit operator ManagementPolicyName(string value) + { + return new ManagementPolicyName(value); + } + + /// Implicit operator to convert ManagementPolicyName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName e) + { + return e._value; + } + + /// Overriding != operator for enum ManagementPolicyName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ManagementPolicyName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ManagementPolicyName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/MigrationState.Completer.cs b/swaggerci/storage/generated/api/Support/MigrationState.Completer.cs new file mode 100644 index 000000000000..e612b6cb545a --- /dev/null +++ b/swaggerci/storage/generated/api/Support/MigrationState.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationStateTypeConverter))] + public partial struct MigrationState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Completed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Completed'", "Completed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Completed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/MigrationState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/MigrationState.TypeConverter.cs new file mode 100644 index 000000000000..ed83074726c5 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/MigrationState.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + public partial class MigrationStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MigrationState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/MigrationState.cs b/swaggerci/storage/generated/api/Support/MigrationState.cs new file mode 100644 index 000000000000..d60d7ec84c54 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/MigrationState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This property denotes the container level immutability to object level immutability migration state. + /// + public partial struct MigrationState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState Completed = @"Completed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState InProgress = @"InProgress"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MigrationState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MigrationState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MigrationState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MigrationState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MigrationState && Equals((MigrationState)obj); + } + + /// Returns hashCode for enum MigrationState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private MigrationState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MigrationState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MigrationState + /// the value to convert to an instance of . + + public static implicit operator MigrationState(string value) + { + return new MigrationState(value); + } + + /// Implicit operator to convert MigrationState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState e) + { + return e._value; + } + + /// Overriding != operator for enum MigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MigrationState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MigrationState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/MinimumTlsVersion.Completer.cs b/swaggerci/storage/generated/api/Support/MinimumTlsVersion.Completer.cs new file mode 100644 index 000000000000..0893827a04a4 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/MinimumTlsVersion.Completer.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersionTypeConverter))] + public partial struct MinimumTlsVersion : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TLS1_0".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TLS1_0'", "TLS1_0", global::System.Management.Automation.CompletionResultType.ParameterValue, "TLS1_0"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TLS1_1".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TLS1_1'", "TLS1_1", global::System.Management.Automation.CompletionResultType.ParameterValue, "TLS1_1"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TLS1_2".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TLS1_2'", "TLS1_2", global::System.Management.Automation.CompletionResultType.ParameterValue, "TLS1_2"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/MinimumTlsVersion.TypeConverter.cs b/swaggerci/storage/generated/api/Support/MinimumTlsVersion.TypeConverter.cs new file mode 100644 index 000000000000..014df8fc93ed --- /dev/null +++ b/swaggerci/storage/generated/api/Support/MinimumTlsVersion.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + public partial class MinimumTlsVersionTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => MinimumTlsVersion.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/MinimumTlsVersion.cs b/swaggerci/storage/generated/api/Support/MinimumTlsVersion.cs new file mode 100644 index 000000000000..1256a5296e04 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/MinimumTlsVersion.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + public partial struct MinimumTlsVersion : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion Tls10 = @"TLS1_0"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion Tls11 = @"TLS1_1"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion Tls12 = @"TLS1_2"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to MinimumTlsVersion + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new MinimumTlsVersion(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type MinimumTlsVersion + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type MinimumTlsVersion (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is MinimumTlsVersion && Equals((MinimumTlsVersion)obj); + } + + /// Returns hashCode for enum MinimumTlsVersion + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private MinimumTlsVersion(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for MinimumTlsVersion + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to MinimumTlsVersion + /// the value to convert to an instance of . + + public static implicit operator MinimumTlsVersion(string value) + { + return new MinimumTlsVersion(value); + } + + /// Implicit operator to convert MinimumTlsVersion to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion e) + { + return e._value; + } + + /// Overriding != operator for enum MinimumTlsVersion + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum MinimumTlsVersion + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Name.Completer.cs b/swaggerci/storage/generated/api/Support/Name.Completer.cs new file mode 100644 index 000000000000..9e492cf0f80d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Name.Completer.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.NameTypeConverter))] + public partial struct Name : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AccessTimeTracking".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AccessTimeTracking'", "AccessTimeTracking", global::System.Management.Automation.CompletionResultType.ParameterValue, "AccessTimeTracking"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Name.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Name.TypeConverter.cs new file mode 100644 index 000000000000..384a32c427f2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Name.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + public partial class NameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Name.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Name.cs b/swaggerci/storage/generated/api/Support/Name.cs new file mode 100644 index 000000000000..2a1d07ca329e --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Name.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Name of the policy. The valid value is AccessTimeTracking. This field is currently read only + /// + public partial struct Name : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name AccessTimeTracking = @"AccessTimeTracking"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Name + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Name(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Name + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Name (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Name && Equals((Name)obj); + } + + /// Returns hashCode for enum Name + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Name(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Name + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Name + /// the value to convert to an instance of . + + public static implicit operator Name(string value) + { + return new Name(value); + } + + /// Implicit operator to convert Name to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name e) + { + return e._value; + } + + /// Overriding != operator for enum Name + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Name + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Name e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ObjectType.Completer.cs b/swaggerci/storage/generated/api/Support/ObjectType.Completer.cs new file mode 100644 index 000000000000..7552727580e9 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ObjectType.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectTypeTypeConverter))] + public partial struct ObjectType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Blob".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Blob'", "Blob", global::System.Management.Automation.CompletionResultType.ParameterValue, "Blob"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Container".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Container'", "Container", global::System.Management.Automation.CompletionResultType.ParameterValue, "Container"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ObjectType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ObjectType.TypeConverter.cs new file mode 100644 index 000000000000..004dfc750213 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ObjectType.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + public partial class ObjectTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ObjectType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ObjectType.cs b/swaggerci/storage/generated/api/Support/ObjectType.cs new file mode 100644 index 000000000000..61fb03552873 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ObjectType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This is a required field. This field specifies the scope of the inventory created either at the blob or container level. + /// + public partial struct ObjectType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType Blob = @"Blob"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType Container = @"Container"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ObjectType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ObjectType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ObjectType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ObjectType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ObjectType && Equals((ObjectType)obj); + } + + /// Returns hashCode for enum ObjectType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ObjectType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ObjectType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ObjectType + /// the value to convert to an instance of . + + public static implicit operator ObjectType(string value) + { + return new ObjectType(value); + } + + /// Implicit operator to convert ObjectType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType e) + { + return e._value; + } + + /// Overriding != operator for enum ObjectType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ObjectType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ObjectType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Permissions.Completer.cs b/swaggerci/storage/generated/api/Support/Permissions.Completer.cs new file mode 100644 index 000000000000..b7e6a44ff8f4 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Permissions.Completer.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PermissionsTypeConverter))] + public partial struct Permissions : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "r".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'r'", "r", global::System.Management.Automation.CompletionResultType.ParameterValue, "r"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "d".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'d'", "d", global::System.Management.Automation.CompletionResultType.ParameterValue, "d"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "w".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'w'", "w", global::System.Management.Automation.CompletionResultType.ParameterValue, "w"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "l".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'l'", "l", global::System.Management.Automation.CompletionResultType.ParameterValue, "l"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "a".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'a'", "a", global::System.Management.Automation.CompletionResultType.ParameterValue, "a"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "c".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'c'", "c", global::System.Management.Automation.CompletionResultType.ParameterValue, "c"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "u".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'u'", "u", global::System.Management.Automation.CompletionResultType.ParameterValue, "u"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "p".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'p'", "p", global::System.Management.Automation.CompletionResultType.ParameterValue, "p"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Permissions.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Permissions.TypeConverter.cs new file mode 100644 index 000000000000..50ca03892ac2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Permissions.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + public partial class PermissionsTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Permissions.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Permissions.cs b/swaggerci/storage/generated/api/Support/Permissions.cs new file mode 100644 index 000000000000..fb0c5574d5c6 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Permissions.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + public partial struct Permissions : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions A = @"a"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions C = @"c"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions D = @"d"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions L = @"l"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions P = @"p"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions R = @"r"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions U = @"u"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions W = @"w"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Permissions + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Permissions(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Permissions + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Permissions (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Permissions && Equals((Permissions)obj); + } + + /// Returns hashCode for enum Permissions + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Permissions(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Permissions + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Permissions + /// the value to convert to an instance of . + + public static implicit operator Permissions(string value) + { + return new Permissions(value); + } + + /// Implicit operator to convert Permissions to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions e) + { + return e._value; + } + + /// Overriding != operator for enum Permissions + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Permissions + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs b/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs new file mode 100644 index 000000000000..fe05f40e14fd --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The current provisioning state. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningStateTypeConverter))] + public partial struct PrivateEndpointConnectionProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deleting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deleting'", "Deleting", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deleting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..db14740f8b6d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The current provisioning state. + public partial class PrivateEndpointConnectionProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PrivateEndpointConnectionProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs b/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs new file mode 100644 index 000000000000..c3b361180ee1 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PrivateEndpointConnectionProvisioningState.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The current provisioning state. + public partial struct PrivateEndpointConnectionProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState Deleting = @"Deleting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState Succeeded = @"Succeeded"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PrivateEndpointConnectionProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PrivateEndpointConnectionProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PrivateEndpointConnectionProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PrivateEndpointConnectionProvisioningState (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PrivateEndpointConnectionProvisioningState && Equals((PrivateEndpointConnectionProvisioningState)obj); + } + + /// Returns hashCode for enum PrivateEndpointConnectionProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private PrivateEndpointConnectionProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PrivateEndpointConnectionProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// + /// Implicit operator to convert string to PrivateEndpointConnectionProvisioningState + /// + /// the value to convert to an instance of . + + public static implicit operator PrivateEndpointConnectionProvisioningState(string value) + { + return new PrivateEndpointConnectionProvisioningState(value); + } + + /// + /// Implicit operator to convert PrivateEndpointConnectionProvisioningState to string + /// + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum PrivateEndpointConnectionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PrivateEndpointConnectionProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointConnectionProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs b/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs new file mode 100644 index 000000000000..6ffced4a0691 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The private endpoint connection status. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatusTypeConverter))] + public partial struct PrivateEndpointServiceConnectionStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Pending".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Pending'", "Pending", global::System.Management.Automation.CompletionResultType.ParameterValue, "Pending"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Approved".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Approved'", "Approved", global::System.Management.Automation.CompletionResultType.ParameterValue, "Approved"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Rejected".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Rejected'", "Rejected", global::System.Management.Automation.CompletionResultType.ParameterValue, "Rejected"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs new file mode 100644 index 000000000000..69fb13198971 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The private endpoint connection status. + public partial class PrivateEndpointServiceConnectionStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PrivateEndpointServiceConnectionStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs b/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs new file mode 100644 index 000000000000..c8e56c6fd30f --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PrivateEndpointServiceConnectionStatus.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The private endpoint connection status. + public partial struct PrivateEndpointServiceConnectionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus Approved = @"Approved"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus Pending = @"Pending"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus Rejected = @"Rejected"; + + /// + /// the value for an instance of the Enum. + /// + private string _value { get; set; } + + /// Conversion from arbitrary object to PrivateEndpointServiceConnectionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PrivateEndpointServiceConnectionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PrivateEndpointServiceConnectionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus e) + { + return _value.Equals(e._value); + } + + /// + /// Compares values of enum type PrivateEndpointServiceConnectionStatus (override for Object) + /// + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PrivateEndpointServiceConnectionStatus && Equals((PrivateEndpointServiceConnectionStatus)obj); + } + + /// Returns hashCode for enum PrivateEndpointServiceConnectionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// + /// Creates an instance of the Enum class. + /// + /// the value to create an instance for. + private PrivateEndpointServiceConnectionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PrivateEndpointServiceConnectionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PrivateEndpointServiceConnectionStatus + /// the value to convert to an instance of . + + public static implicit operator PrivateEndpointServiceConnectionStatus(string value) + { + return new PrivateEndpointServiceConnectionStatus(value); + } + + /// Implicit operator to convert PrivateEndpointServiceConnectionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum PrivateEndpointServiceConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PrivateEndpointServiceConnectionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PrivateEndpointServiceConnectionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ProvisioningState.Completer.cs b/swaggerci/storage/generated/api/Support/ProvisioningState.Completer.cs new file mode 100644 index 000000000000..6ccbae3f8818 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ProvisioningState.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the status of the storage account at the time the operation was called. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningStateTypeConverter))] + public partial struct ProvisioningState : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Creating".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Creating'", "Creating", global::System.Management.Automation.CompletionResultType.ParameterValue, "Creating"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "ResolvingDNS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'ResolvingDNS'", "ResolvingDNS", global::System.Management.Automation.CompletionResultType.ParameterValue, "ResolvingDNS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ProvisioningState.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ProvisioningState.TypeConverter.cs new file mode 100644 index 000000000000..3d9cf80456fc --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ProvisioningState.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the status of the storage account at the time the operation was called. + public partial class ProvisioningStateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ProvisioningState.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ProvisioningState.cs b/swaggerci/storage/generated/api/Support/ProvisioningState.cs new file mode 100644 index 000000000000..1d8ac29dd03f --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ProvisioningState.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the status of the storage account at the time the operation was called. + public partial struct ProvisioningState : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState Creating = @"Creating"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState ResolvingDns = @"ResolvingDNS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ProvisioningState + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ProvisioningState(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ProvisioningState + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ProvisioningState (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ProvisioningState && Equals((ProvisioningState)obj); + } + + /// Returns hashCode for enum ProvisioningState + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ProvisioningState(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ProvisioningState + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ProvisioningState + /// the value to convert to an instance of . + + public static implicit operator ProvisioningState(string value) + { + return new ProvisioningState(value); + } + + /// Implicit operator to convert ProvisioningState to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState e) + { + return e._value; + } + + /// Overriding != operator for enum ProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ProvisioningState + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ProvisioningState e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PublicAccess.Completer.cs b/swaggerci/storage/generated/api/Support/PublicAccess.Completer.cs new file mode 100644 index 000000000000..a4ae560bb61f --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PublicAccess.Completer.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccessTypeConverter))] + public partial struct PublicAccess : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Container".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Container'", "Container", global::System.Management.Automation.CompletionResultType.ParameterValue, "Container"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Blob".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Blob'", "Blob", global::System.Management.Automation.CompletionResultType.ParameterValue, "Blob"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "None".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'None'", "None", global::System.Management.Automation.CompletionResultType.ParameterValue, "None"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PublicAccess.TypeConverter.cs b/swaggerci/storage/generated/api/Support/PublicAccess.TypeConverter.cs new file mode 100644 index 000000000000..17739cc89a04 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PublicAccess.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + public partial class PublicAccessTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PublicAccess.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PublicAccess.cs b/swaggerci/storage/generated/api/Support/PublicAccess.cs new file mode 100644 index 000000000000..61177ae2bdb6 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PublicAccess.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Specifies whether data in the container may be accessed publicly and the level of access. + /// + public partial struct PublicAccess : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess Blob = @"Blob"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess Container = @"Container"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess None = @"None"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PublicAccess + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PublicAccess(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PublicAccess + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PublicAccess (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PublicAccess && Equals((PublicAccess)obj); + } + + /// Returns hashCode for enum PublicAccess + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PublicAccess(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PublicAccess + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PublicAccess + /// the value to convert to an instance of . + + public static implicit operator PublicAccess(string value) + { + return new PublicAccess(value); + } + + /// Implicit operator to convert PublicAccess to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess e) + { + return e._value; + } + + /// Overriding != operator for enum PublicAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PublicAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicAccess e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PublicNetworkAccess.Completer.cs b/swaggerci/storage/generated/api/Support/PublicNetworkAccess.Completer.cs new file mode 100644 index 000000000000..c37856648ee3 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PublicNetworkAccess.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccessTypeConverter))] + public partial struct PublicNetworkAccess : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Enabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Enabled'", "Enabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Enabled"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Disabled".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Disabled'", "Disabled", global::System.Management.Automation.CompletionResultType.ParameterValue, "Disabled"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PublicNetworkAccess.TypeConverter.cs b/swaggerci/storage/generated/api/Support/PublicNetworkAccess.TypeConverter.cs new file mode 100644 index 000000000000..1b3e44c48470 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PublicNetworkAccess.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + public partial class PublicNetworkAccessTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => PublicNetworkAccess.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/PublicNetworkAccess.cs b/swaggerci/storage/generated/api/Support/PublicNetworkAccess.cs new file mode 100644 index 000000000000..7f6e1256339b --- /dev/null +++ b/swaggerci/storage/generated/api/Support/PublicNetworkAccess.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + public partial struct PublicNetworkAccess : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess Disabled = @"Disabled"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess Enabled = @"Enabled"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to PublicNetworkAccess + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new PublicNetworkAccess(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type PublicNetworkAccess + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type PublicNetworkAccess (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is PublicNetworkAccess && Equals((PublicNetworkAccess)obj); + } + + /// Returns hashCode for enum PublicNetworkAccess + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private PublicNetworkAccess(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for PublicNetworkAccess + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to PublicNetworkAccess + /// the value to convert to an instance of . + + public static implicit operator PublicNetworkAccess(string value) + { + return new PublicNetworkAccess(value); + } + + /// Implicit operator to convert PublicNetworkAccess to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess e) + { + return e._value; + } + + /// Overriding != operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum PublicNetworkAccess + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/QueueServiceName.Completer.cs b/swaggerci/storage/generated/api/Support/QueueServiceName.Completer.cs new file mode 100644 index 000000000000..ba22559c56b4 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/QueueServiceName.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for QueueServiceName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceNameTypeConverter))] + public partial struct QueueServiceName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'default'", "default", global::System.Management.Automation.CompletionResultType.ParameterValue, "default"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/QueueServiceName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/QueueServiceName.TypeConverter.cs new file mode 100644 index 000000000000..e5629aa6108d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/QueueServiceName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for QueueServiceName. + public partial class QueueServiceNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => QueueServiceName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/QueueServiceName.cs b/swaggerci/storage/generated/api/Support/QueueServiceName.cs new file mode 100644 index 000000000000..32ab4dd3034c --- /dev/null +++ b/swaggerci/storage/generated/api/Support/QueueServiceName.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct QueueServiceName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to QueueServiceName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new QueueServiceName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type QueueServiceName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type QueueServiceName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is QueueServiceName && Equals((QueueServiceName)obj); + } + + /// Returns hashCode for enum QueueServiceName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private QueueServiceName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for QueueServiceName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to QueueServiceName + /// the value to convert to an instance of . + + public static implicit operator QueueServiceName(string value) + { + return new QueueServiceName(value); + } + + /// Implicit operator to convert QueueServiceName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName e) + { + return e._value; + } + + /// Overriding != operator for enum QueueServiceName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum QueueServiceName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.QueueServiceName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Reason.Completer.cs b/swaggerci/storage/generated/api/Support/Reason.Completer.cs new file mode 100644 index 000000000000..87b5b570e50c --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Reason.Completer.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is + /// false. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonTypeConverter))] + public partial struct Reason : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AccountNameInvalid".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AccountNameInvalid'", "AccountNameInvalid", global::System.Management.Automation.CompletionResultType.ParameterValue, "AccountNameInvalid"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AlreadyExists".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AlreadyExists'", "AlreadyExists", global::System.Management.Automation.CompletionResultType.ParameterValue, "AlreadyExists"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Reason.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Reason.TypeConverter.cs new file mode 100644 index 000000000000..e6023d21ab6a --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Reason.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is + /// false. + /// + public partial class ReasonTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Reason.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Reason.cs b/swaggerci/storage/generated/api/Support/Reason.cs new file mode 100644 index 000000000000..325c9561052b --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Reason.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Gets the reason that a storage account name could not be used. The Reason element is only returned if NameAvailable is + /// false. + /// + public partial struct Reason : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason AccountNameInvalid = @"AccountNameInvalid"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason AlreadyExists = @"AlreadyExists"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Reason + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Reason(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Reason + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Reason (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Reason && Equals((Reason)obj); + } + + /// Returns hashCode for enum Reason + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Reason(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Reason + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Reason + /// the value to convert to an instance of . + + public static implicit operator Reason(string value) + { + return new Reason(value); + } + + /// Implicit operator to convert Reason to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason e) + { + return e._value; + } + + /// Overriding != operator for enum Reason + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Reason + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Reason e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ReasonCode.Completer.cs b/swaggerci/storage/generated/api/Support/ReasonCode.Completer.cs new file mode 100644 index 000000000000..1c41ece5e6c5 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ReasonCode.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when + /// the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" + /// is related to capacity at DC. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCodeTypeConverter))] + public partial struct ReasonCode : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "QuotaId".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'QuotaId'", "QuotaId", global::System.Management.Automation.CompletionResultType.ParameterValue, "QuotaId"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NotAvailableForSubscription".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NotAvailableForSubscription'", "NotAvailableForSubscription", global::System.Management.Automation.CompletionResultType.ParameterValue, "NotAvailableForSubscription"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ReasonCode.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ReasonCode.TypeConverter.cs new file mode 100644 index 000000000000..4256e383b5b5 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ReasonCode.TypeConverter.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when + /// the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" + /// is related to capacity at DC. + /// + public partial class ReasonCodeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ReasonCode.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ReasonCode.cs b/swaggerci/storage/generated/api/Support/ReasonCode.cs new file mode 100644 index 000000000000..8e3ae5f291f2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ReasonCode.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The reason for the restriction. As of now this can be "QuotaId" or "NotAvailableForSubscription". Quota Id is set when + /// the SKU has requiredQuotas parameter as the subscription does not belong to that quota. The "NotAvailableForSubscription" + /// is related to capacity at DC. + /// + public partial struct ReasonCode : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode NotAvailableForSubscription = @"NotAvailableForSubscription"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode QuotaId = @"QuotaId"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ReasonCode + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ReasonCode(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ReasonCode + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ReasonCode (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ReasonCode && Equals((ReasonCode)obj); + } + + /// Returns hashCode for enum ReasonCode + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ReasonCode(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ReasonCode + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ReasonCode + /// the value to convert to an instance of . + + public static implicit operator ReasonCode(string value) + { + return new ReasonCode(value); + } + + /// Implicit operator to convert ReasonCode to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode e) + { + return e._value; + } + + /// Overriding != operator for enum ReasonCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ReasonCode + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ReasonCode e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/RootSquashType.Completer.cs b/swaggerci/storage/generated/api/Support/RootSquashType.Completer.cs new file mode 100644 index 000000000000..de352cebacaa --- /dev/null +++ b/swaggerci/storage/generated/api/Support/RootSquashType.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The property is for NFS share only. The default is NoRootSquash. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashTypeTypeConverter))] + public partial struct RootSquashType : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NoRootSquash".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NoRootSquash'", "NoRootSquash", global::System.Management.Automation.CompletionResultType.ParameterValue, "NoRootSquash"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "RootSquash".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'RootSquash'", "RootSquash", global::System.Management.Automation.CompletionResultType.ParameterValue, "RootSquash"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "AllSquash".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'AllSquash'", "AllSquash", global::System.Management.Automation.CompletionResultType.ParameterValue, "AllSquash"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/RootSquashType.TypeConverter.cs b/swaggerci/storage/generated/api/Support/RootSquashType.TypeConverter.cs new file mode 100644 index 000000000000..8dd92e015dd2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/RootSquashType.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The property is for NFS share only. The default is NoRootSquash. + public partial class RootSquashTypeTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RootSquashType.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/RootSquashType.cs b/swaggerci/storage/generated/api/Support/RootSquashType.cs new file mode 100644 index 000000000000..fdaeb96e4655 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/RootSquashType.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The property is for NFS share only. The default is NoRootSquash. + public partial struct RootSquashType : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType AllSquash = @"AllSquash"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType NoRootSquash = @"NoRootSquash"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType RootSquash = @"RootSquash"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RootSquashType + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RootSquashType(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RootSquashType + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RootSquashType (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RootSquashType && Equals((RootSquashType)obj); + } + + /// Returns hashCode for enum RootSquashType + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private RootSquashType(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RootSquashType + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RootSquashType + /// the value to convert to an instance of . + + public static implicit operator RootSquashType(string value) + { + return new RootSquashType(value); + } + + /// Implicit operator to convert RootSquashType to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType e) + { + return e._value; + } + + /// Overriding != operator for enum RootSquashType + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RootSquashType + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/RoutingChoice.Completer.cs b/swaggerci/storage/generated/api/Support/RoutingChoice.Completer.cs new file mode 100644 index 000000000000..9211b7eaec92 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/RoutingChoice.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Routing Choice defines the kind of network routing opted by the user. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoiceTypeConverter))] + public partial struct RoutingChoice : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "MicrosoftRouting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'MicrosoftRouting'", "MicrosoftRouting", global::System.Management.Automation.CompletionResultType.ParameterValue, "MicrosoftRouting"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InternetRouting".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InternetRouting'", "InternetRouting", global::System.Management.Automation.CompletionResultType.ParameterValue, "InternetRouting"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/RoutingChoice.TypeConverter.cs b/swaggerci/storage/generated/api/Support/RoutingChoice.TypeConverter.cs new file mode 100644 index 000000000000..0d4e3656cc8e --- /dev/null +++ b/swaggerci/storage/generated/api/Support/RoutingChoice.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Routing Choice defines the kind of network routing opted by the user. + public partial class RoutingChoiceTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => RoutingChoice.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/RoutingChoice.cs b/swaggerci/storage/generated/api/Support/RoutingChoice.cs new file mode 100644 index 000000000000..175b5d747844 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/RoutingChoice.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Routing Choice defines the kind of network routing opted by the user. + public partial struct RoutingChoice : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice InternetRouting = @"InternetRouting"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice MicrosoftRouting = @"MicrosoftRouting"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to RoutingChoice + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new RoutingChoice(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type RoutingChoice + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type RoutingChoice (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is RoutingChoice && Equals((RoutingChoice)obj); + } + + /// Returns hashCode for enum RoutingChoice + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private RoutingChoice(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for RoutingChoice + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to RoutingChoice + /// the value to convert to an instance of . + + public static implicit operator RoutingChoice(string value) + { + return new RoutingChoice(value); + } + + /// Implicit operator to convert RoutingChoice to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice e) + { + return e._value; + } + + /// Overriding != operator for enum RoutingChoice + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum RoutingChoice + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Schedule.Completer.cs b/swaggerci/storage/generated/api/Support/Schedule.Completer.cs new file mode 100644 index 000000000000..6e739516f8fd --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Schedule.Completer.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ScheduleTypeConverter))] + public partial struct Schedule : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Daily".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Daily'", "Daily", global::System.Management.Automation.CompletionResultType.ParameterValue, "Daily"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Weekly".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Weekly'", "Weekly", global::System.Management.Automation.CompletionResultType.ParameterValue, "Weekly"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Schedule.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Schedule.TypeConverter.cs new file mode 100644 index 000000000000..9ec08f50d973 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Schedule.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + public partial class ScheduleTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Schedule.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Schedule.cs b/swaggerci/storage/generated/api/Support/Schedule.cs new file mode 100644 index 000000000000..267ee768c2ee --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Schedule.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// This is a required field. This field is used to schedule an inventory formation. + /// + public partial struct Schedule : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule Daily = @"Daily"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule Weekly = @"Weekly"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Schedule + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Schedule(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Schedule + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Schedule (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Schedule && Equals((Schedule)obj); + } + + /// Returns hashCode for enum Schedule + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Schedule(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Schedule + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Schedule + /// the value to convert to an instance of . + + public static implicit operator Schedule(string value) + { + return new Schedule(value); + } + + /// Implicit operator to convert Schedule to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule e) + { + return e._value; + } + + /// Overriding != operator for enum Schedule + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Schedule + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Schedule e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Services.Completer.cs b/swaggerci/storage/generated/api/Support/Services.Completer.cs new file mode 100644 index 000000000000..2d4c4d27c006 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Services.Completer.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ServicesTypeConverter))] + public partial struct Services : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "b".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'b'", "b", global::System.Management.Automation.CompletionResultType.ParameterValue, "b"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "q".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'q'", "q", global::System.Management.Automation.CompletionResultType.ParameterValue, "q"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "t".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'t'", "t", global::System.Management.Automation.CompletionResultType.ParameterValue, "t"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "f".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'f'", "f", global::System.Management.Automation.CompletionResultType.ParameterValue, "f"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Services.TypeConverter.cs b/swaggerci/storage/generated/api/Support/Services.TypeConverter.cs new file mode 100644 index 000000000000..9b9349e4475e --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Services.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + /// + public partial class ServicesTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => Services.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/Services.cs b/swaggerci/storage/generated/api/Support/Services.cs new file mode 100644 index 000000000000..66b0a5b46d86 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/Services.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + /// + public partial struct Services : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services B = @"b"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services F = @"f"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services Q = @"q"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services T = @"t"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to Services + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new Services(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type Services + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type Services (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is Services && Equals((Services)obj); + } + + /// Returns hashCode for enum Services + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private Services(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for Services + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to Services + /// the value to convert to an instance of . + + public static implicit operator Services(string value) + { + return new Services(value); + } + + /// Implicit operator to convert Services to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services e) + { + return e._value; + } + + /// Overriding != operator for enum Services + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum Services + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ShareAccessTier.Completer.cs b/swaggerci/storage/generated/api/Support/ShareAccessTier.Completer.cs new file mode 100644 index 000000000000..9bae78219421 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ShareAccessTier.Completer.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTierTypeConverter))] + public partial struct ShareAccessTier : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "TransactionOptimized".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'TransactionOptimized'", "TransactionOptimized", global::System.Management.Automation.CompletionResultType.ParameterValue, "TransactionOptimized"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Hot".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Hot'", "Hot", global::System.Management.Automation.CompletionResultType.ParameterValue, "Hot"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Cool".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Cool'", "Cool", global::System.Management.Automation.CompletionResultType.ParameterValue, "Cool"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Premium".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Premium'", "Premium", global::System.Management.Automation.CompletionResultType.ParameterValue, "Premium"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ShareAccessTier.TypeConverter.cs b/swaggerci/storage/generated/api/Support/ShareAccessTier.TypeConverter.cs new file mode 100644 index 000000000000..0f564b88f30f --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ShareAccessTier.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + public partial class ShareAccessTierTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ShareAccessTier.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/ShareAccessTier.cs b/swaggerci/storage/generated/api/Support/ShareAccessTier.cs new file mode 100644 index 000000000000..996382d873f8 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/ShareAccessTier.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + public partial struct ShareAccessTier : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier Cool = @"Cool"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier Hot = @"Hot"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier Premium = @"Premium"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier TransactionOptimized = @"TransactionOptimized"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to ShareAccessTier + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new ShareAccessTier(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type ShareAccessTier + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type ShareAccessTier (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is ShareAccessTier && Equals((ShareAccessTier)obj); + } + + /// Returns hashCode for enum ShareAccessTier + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private ShareAccessTier(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for ShareAccessTier + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to ShareAccessTier + /// the value to convert to an instance of . + + public static implicit operator ShareAccessTier(string value) + { + return new ShareAccessTier(value); + } + + /// Implicit operator to convert ShareAccessTier to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier e) + { + return e._value; + } + + /// Overriding != operator for enum ShareAccessTier + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum ShareAccessTier + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SignedResource.Completer.cs b/swaggerci/storage/generated/api/Support/SignedResource.Completer.cs new file mode 100644 index 000000000000..9d2728a45fef --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SignedResource.Completer.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share + /// (s). + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypeConverter))] + public partial struct SignedResource : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "b".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'b'", "b", global::System.Management.Automation.CompletionResultType.ParameterValue, "b"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "c".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'c'", "c", global::System.Management.Automation.CompletionResultType.ParameterValue, "c"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "f".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'f'", "f", global::System.Management.Automation.CompletionResultType.ParameterValue, "f"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "s".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'s'", "s", global::System.Management.Automation.CompletionResultType.ParameterValue, "s"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SignedResource.TypeConverter.cs b/swaggerci/storage/generated/api/Support/SignedResource.TypeConverter.cs new file mode 100644 index 000000000000..6d30f544a7ca --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SignedResource.TypeConverter.cs @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share + /// (s). + /// + public partial class SignedResourceTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SignedResource.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SignedResource.cs b/swaggerci/storage/generated/api/Support/SignedResource.cs new file mode 100644 index 000000000000..a64854ed158d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SignedResource.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share + /// (s). + /// + public partial struct SignedResource : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource B = @"b"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource C = @"c"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource F = @"f"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource S = @"s"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SignedResource + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SignedResource(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SignedResource + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SignedResource (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SignedResource && Equals((SignedResource)obj); + } + + /// Returns hashCode for enum SignedResource + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SignedResource(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SignedResource + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SignedResource + /// the value to convert to an instance of . + + public static implicit operator SignedResource(string value) + { + return new SignedResource(value); + } + + /// Implicit operator to convert SignedResource to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource e) + { + return e._value; + } + + /// Overriding != operator for enum SignedResource + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SignedResource + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SignedResourceTypes.Completer.cs b/swaggerci/storage/generated/api/Support/SignedResourceTypes.Completer.cs new file mode 100644 index 000000000000..de71f640a3e0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SignedResourceTypes.Completer.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container + /// (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, + /// and files. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypesTypeConverter))] + public partial struct SignedResourceTypes : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "s".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'s'", "s", global::System.Management.Automation.CompletionResultType.ParameterValue, "s"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "c".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'c'", "c", global::System.Management.Automation.CompletionResultType.ParameterValue, "c"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "o".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'o'", "o", global::System.Management.Automation.CompletionResultType.ParameterValue, "o"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SignedResourceTypes.TypeConverter.cs b/swaggerci/storage/generated/api/Support/SignedResourceTypes.TypeConverter.cs new file mode 100644 index 000000000000..eaf61ade8352 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SignedResourceTypes.TypeConverter.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container + /// (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, + /// and files. + /// + public partial class SignedResourceTypesTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SignedResourceTypes.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SignedResourceTypes.cs b/swaggerci/storage/generated/api/Support/SignedResourceTypes.cs new file mode 100644 index 000000000000..ec71069f1274 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SignedResourceTypes.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container + /// (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, + /// and files. + /// + public partial struct SignedResourceTypes : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes C = @"c"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes O = @"o"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes S = @"s"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SignedResourceTypes + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SignedResourceTypes(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SignedResourceTypes + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SignedResourceTypes (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SignedResourceTypes && Equals((SignedResourceTypes)obj); + } + + /// Returns hashCode for enum SignedResourceTypes + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SignedResourceTypes(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SignedResourceTypes + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SignedResourceTypes + /// the value to convert to an instance of . + + public static implicit operator SignedResourceTypes(string value) + { + return new SignedResourceTypes(value); + } + + /// Implicit operator to convert SignedResourceTypes to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes e) + { + return e._value; + } + + /// Overriding != operator for enum SignedResourceTypes + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SignedResourceTypes + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuConversionStatus.Completer.cs b/swaggerci/storage/generated/api/Support/SkuConversionStatus.Completer.cs new file mode 100644 index 000000000000..165332ed95ea --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuConversionStatus.Completer.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// This property indicates the current sku conversion status. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatusTypeConverter))] + public partial struct SkuConversionStatus : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "InProgress".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'InProgress'", "InProgress", global::System.Management.Automation.CompletionResultType.ParameterValue, "InProgress"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuConversionStatus.TypeConverter.cs b/swaggerci/storage/generated/api/Support/SkuConversionStatus.TypeConverter.cs new file mode 100644 index 000000000000..2c35201d9de2 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuConversionStatus.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// This property indicates the current sku conversion status. + public partial class SkuConversionStatusTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SkuConversionStatus.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuConversionStatus.cs b/swaggerci/storage/generated/api/Support/SkuConversionStatus.cs new file mode 100644 index 000000000000..3a9fa3d187f0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuConversionStatus.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// This property indicates the current sku conversion status. + public partial struct SkuConversionStatus : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus InProgress = @"InProgress"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuConversionStatus + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuConversionStatus(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuConversionStatus + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuConversionStatus (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SkuConversionStatus && Equals((SkuConversionStatus)obj); + } + + /// Returns hashCode for enum SkuConversionStatus + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SkuConversionStatus(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuConversionStatus + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuConversionStatus + /// the value to convert to an instance of . + + public static implicit operator SkuConversionStatus(string value) + { + return new SkuConversionStatus(value); + } + + /// Implicit operator to convert SkuConversionStatus to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus e) + { + return e._value; + } + + /// Overriding != operator for enum SkuConversionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuConversionStatus + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuConversionStatus e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuName.Completer.cs b/swaggerci/storage/generated/api/Support/SkuName.Completer.cs new file mode 100644 index 000000000000..1d97641380c0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuName.Completer.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuNameTypeConverter))] + public partial struct SkuName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard_LRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard_LRS'", "Standard_LRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard_LRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard_GRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard_GRS'", "Standard_GRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard_GRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard_RAGRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard_RAGRS'", "Standard_RAGRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard_RAGRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard_ZRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard_ZRS'", "Standard_ZRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard_ZRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Premium_LRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Premium_LRS'", "Premium_LRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Premium_LRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Premium_ZRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Premium_ZRS'", "Premium_ZRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Premium_ZRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard_GZRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard_GZRS'", "Standard_GZRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard_GZRS"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard_RAGZRS".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard_RAGZRS'", "Standard_RAGZRS", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard_RAGZRS"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/SkuName.TypeConverter.cs new file mode 100644 index 000000000000..2691000c9d01 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuName.TypeConverter.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + public partial class SkuNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SkuName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuName.cs b/swaggerci/storage/generated/api/Support/SkuName.cs new file mode 100644 index 000000000000..8a2a6af42fb3 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuName.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + public partial struct SkuName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName PremiumLrs = @"Premium_LRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName PremiumZrs = @"Premium_ZRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName StandardGrs = @"Standard_GRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName StandardGzrs = @"Standard_GZRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName StandardLrs = @"Standard_LRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName StandardRagrs = @"Standard_RAGRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName StandardRagzrs = @"Standard_RAGZRS"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName StandardZrs = @"Standard_ZRS"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SkuName && Equals((SkuName)obj); + } + + /// Returns hashCode for enum SkuName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SkuName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuName + /// the value to convert to an instance of . + + public static implicit operator SkuName(string value) + { + return new SkuName(value); + } + + /// Implicit operator to convert SkuName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName e) + { + return e._value; + } + + /// Overriding != operator for enum SkuName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuTier.Completer.cs b/swaggerci/storage/generated/api/Support/SkuTier.Completer.cs new file mode 100644 index 000000000000..8655a5bf1d62 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuTier.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The SKU tier. This is based on the SKU name. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTierTypeConverter))] + public partial struct SkuTier : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Standard".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Standard'", "Standard", global::System.Management.Automation.CompletionResultType.ParameterValue, "Standard"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Premium".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Premium'", "Premium", global::System.Management.Automation.CompletionResultType.ParameterValue, "Premium"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuTier.TypeConverter.cs b/swaggerci/storage/generated/api/Support/SkuTier.TypeConverter.cs new file mode 100644 index 000000000000..ca3b32e9ecc7 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuTier.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The SKU tier. This is based on the SKU name. + public partial class SkuTierTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => SkuTier.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/SkuTier.cs b/swaggerci/storage/generated/api/Support/SkuTier.cs new file mode 100644 index 000000000000..2357631b86d1 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/SkuTier.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// The SKU tier. This is based on the SKU name. + public partial struct SkuTier : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier Premium = @"Premium"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier Standard = @"Standard"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to SkuTier + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new SkuTier(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type SkuTier + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type SkuTier (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is SkuTier && Equals((SkuTier)obj); + } + + /// Returns hashCode for enum SkuTier + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private SkuTier(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for SkuTier + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to SkuTier + /// the value to convert to an instance of . + + public static implicit operator SkuTier(string value) + { + return new SkuTier(value); + } + + /// Implicit operator to convert SkuTier to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier e) + { + return e._value; + } + + /// Overriding != operator for enum SkuTier + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum SkuTier + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuTier e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/State.Completer.cs b/swaggerci/storage/generated/api/Support/State.Completer.cs new file mode 100644 index 000000000000..43a0d4afebee --- /dev/null +++ b/swaggerci/storage/generated/api/Support/State.Completer.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the state of virtual network rule. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StateTypeConverter))] + public partial struct State : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Provisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Provisioning'", "Provisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Provisioning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Deprovisioning".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Deprovisioning'", "Deprovisioning", global::System.Management.Automation.CompletionResultType.ParameterValue, "Deprovisioning"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Succeeded".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Succeeded'", "Succeeded", global::System.Management.Automation.CompletionResultType.ParameterValue, "Succeeded"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Failed".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Failed'", "Failed", global::System.Management.Automation.CompletionResultType.ParameterValue, "Failed"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "NetworkSourceDeleted".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'NetworkSourceDeleted'", "NetworkSourceDeleted", global::System.Management.Automation.CompletionResultType.ParameterValue, "NetworkSourceDeleted"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/State.TypeConverter.cs b/swaggerci/storage/generated/api/Support/State.TypeConverter.cs new file mode 100644 index 000000000000..e489828fe9bb --- /dev/null +++ b/swaggerci/storage/generated/api/Support/State.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the state of virtual network rule. + public partial class StateTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => State.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/State.cs b/swaggerci/storage/generated/api/Support/State.cs new file mode 100644 index 000000000000..b1eb23c3e2d0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/State.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the state of virtual network rule. + public partial struct State : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State Deprovisioning = @"Deprovisioning"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State Failed = @"Failed"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State NetworkSourceDeleted = @"NetworkSourceDeleted"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State Provisioning = @"Provisioning"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State Succeeded = @"Succeeded"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to State + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new State(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type State + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type State (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is State && Equals((State)obj); + } + + /// Returns hashCode for enum State + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private State(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for State + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to State + /// the value to convert to an instance of . + + public static implicit operator State(string value) + { + return new State(value); + } + + /// Implicit operator to convert State to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State e) + { + return e._value; + } + + /// Overriding != operator for enum State + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum State + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.State e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/StorageAccountExpand.Completer.cs b/swaggerci/storage/generated/api/Support/StorageAccountExpand.Completer.cs new file mode 100644 index 000000000000..2d2a759c4a89 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/StorageAccountExpand.Completer.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for StorageAccountExpand. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpandTypeConverter))] + public partial struct StorageAccountExpand : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "geoReplicationStats".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'geoReplicationStats'", "geoReplicationStats", global::System.Management.Automation.CompletionResultType.ParameterValue, "geoReplicationStats"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "blobRestoreStatus".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'blobRestoreStatus'", "blobRestoreStatus", global::System.Management.Automation.CompletionResultType.ParameterValue, "blobRestoreStatus"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/StorageAccountExpand.TypeConverter.cs b/swaggerci/storage/generated/api/Support/StorageAccountExpand.TypeConverter.cs new file mode 100644 index 000000000000..d9e15eda33e3 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/StorageAccountExpand.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for StorageAccountExpand. + public partial class StorageAccountExpandTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => StorageAccountExpand.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/StorageAccountExpand.cs b/swaggerci/storage/generated/api/Support/StorageAccountExpand.cs new file mode 100644 index 000000000000..e68caf23fcf0 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/StorageAccountExpand.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct StorageAccountExpand : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand BlobRestoreStatus = @"blobRestoreStatus"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand GeoReplicationStats = @"geoReplicationStats"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to StorageAccountExpand + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new StorageAccountExpand(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type StorageAccountExpand + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type StorageAccountExpand (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is StorageAccountExpand && Equals((StorageAccountExpand)obj); + } + + /// Returns hashCode for enum StorageAccountExpand + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private StorageAccountExpand(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for StorageAccountExpand + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to StorageAccountExpand + /// the value to convert to an instance of . + + public static implicit operator StorageAccountExpand(string value) + { + return new StorageAccountExpand(value); + } + + /// Implicit operator to convert StorageAccountExpand to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand e) + { + return e._value; + } + + /// Overriding != operator for enum StorageAccountExpand + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum StorageAccountExpand + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/TableServiceName.Completer.cs b/swaggerci/storage/generated/api/Support/TableServiceName.Completer.cs new file mode 100644 index 000000000000..af2e71f05bdb --- /dev/null +++ b/swaggerci/storage/generated/api/Support/TableServiceName.Completer.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Argument completer implementation for TableServiceName. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceNameTypeConverter))] + public partial struct TableServiceName : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "default".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'default'", "default", global::System.Management.Automation.CompletionResultType.ParameterValue, "default"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/TableServiceName.TypeConverter.cs b/swaggerci/storage/generated/api/Support/TableServiceName.TypeConverter.cs new file mode 100644 index 000000000000..1f9a416fc0fb --- /dev/null +++ b/swaggerci/storage/generated/api/Support/TableServiceName.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// TypeConverter implementation for TableServiceName. + public partial class TableServiceNameTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => TableServiceName.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/TableServiceName.cs b/swaggerci/storage/generated/api/Support/TableServiceName.cs new file mode 100644 index 000000000000..36d677b4c61e --- /dev/null +++ b/swaggerci/storage/generated/api/Support/TableServiceName.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + public partial struct TableServiceName : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName Default = @"default"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to TableServiceName + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new TableServiceName(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type TableServiceName + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type TableServiceName (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is TableServiceName && Equals((TableServiceName)obj); + } + + /// Returns hashCode for enum TableServiceName + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private TableServiceName(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Returns string representation for TableServiceName + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Implicit operator to convert string to TableServiceName + /// the value to convert to an instance of . + + public static implicit operator TableServiceName(string value) + { + return new TableServiceName(value); + } + + /// Implicit operator to convert TableServiceName to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName e) + { + return e._value; + } + + /// Overriding != operator for enum TableServiceName + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum TableServiceName + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.TableServiceName e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/UsageUnit.Completer.cs b/swaggerci/storage/generated/api/Support/UsageUnit.Completer.cs new file mode 100644 index 000000000000..50fc7ff3be20 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/UsageUnit.Completer.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the unit of measurement. + [System.ComponentModel.TypeConverter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnitTypeConverter))] + public partial struct UsageUnit : + System.Management.Automation.IArgumentCompleter + { + + /// + /// Implementations of this function are called by PowerShell to complete arguments. + /// + /// The name of the command that needs argument completion. + /// The name of the parameter that needs argument completion. + /// The (possibly empty) word being completed. + /// The command ast in case it is needed for completion. + /// This parameter is similar to $PSBoundParameters, except that sometimes PowerShell cannot + /// or will not attempt to evaluate an argument, in which case you may need to use commandAst. + /// + /// A collection of completion results, most like with ResultType set to ParameterValue. + /// + public global::System.Collections.Generic.IEnumerable CompleteArgument(global::System.String commandName, global::System.String parameterName, global::System.String wordToComplete, global::System.Management.Automation.Language.CommandAst commandAst, global::System.Collections.IDictionary fakeBoundParameters) + { + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Count".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Count'", "Count", global::System.Management.Automation.CompletionResultType.ParameterValue, "Count"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Bytes".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Bytes'", "Bytes", global::System.Management.Automation.CompletionResultType.ParameterValue, "Bytes"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Seconds".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Seconds'", "Seconds", global::System.Management.Automation.CompletionResultType.ParameterValue, "Seconds"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "Percent".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'Percent'", "Percent", global::System.Management.Automation.CompletionResultType.ParameterValue, "Percent"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "CountsPerSecond".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'CountsPerSecond'", "CountsPerSecond", global::System.Management.Automation.CompletionResultType.ParameterValue, "CountsPerSecond"); + } + if (global::System.String.IsNullOrEmpty(wordToComplete) || "BytesPerSecond".StartsWith(wordToComplete, global::System.StringComparison.InvariantCultureIgnoreCase)) + { + yield return new global::System.Management.Automation.CompletionResult("'BytesPerSecond'", "BytesPerSecond", global::System.Management.Automation.CompletionResultType.ParameterValue, "BytesPerSecond"); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/UsageUnit.TypeConverter.cs b/swaggerci/storage/generated/api/Support/UsageUnit.TypeConverter.cs new file mode 100644 index 000000000000..7677493ba90d --- /dev/null +++ b/swaggerci/storage/generated/api/Support/UsageUnit.TypeConverter.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the unit of measurement. + public partial class UsageUnitTypeConverter : + global::System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => true; + + /// + /// Determines if the converter can convert the parameter to the parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the parameter, otherwise false. + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => UsageUnit.CreateFrom(sourceValue); + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/api/Support/UsageUnit.cs b/swaggerci/storage/generated/api/Support/UsageUnit.cs new file mode 100644 index 000000000000..557736114fb4 --- /dev/null +++ b/swaggerci/storage/generated/api/Support/UsageUnit.cs @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Support +{ + + /// Gets the unit of measurement. + public partial struct UsageUnit : + System.IEquatable + { + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit Bytes = @"Bytes"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit BytesPerSecond = @"BytesPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit Count = @"Count"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit CountsPerSecond = @"CountsPerSecond"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit Percent = @"Percent"; + + public static Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit Seconds = @"Seconds"; + + /// the value for an instance of the Enum. + private string _value { get; set; } + + /// Conversion from arbitrary object to UsageUnit + /// the value to convert to an instance of . + internal static object CreateFrom(object value) + { + return new UsageUnit(global::System.Convert.ToString(value)); + } + + /// Compares values of enum type UsageUnit + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public bool Equals(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit e) + { + return _value.Equals(e._value); + } + + /// Compares values of enum type UsageUnit (override for Object) + /// the value to compare against this instance. + /// true if the two instances are equal to the same value + public override bool Equals(object obj) + { + return obj is UsageUnit && Equals((UsageUnit)obj); + } + + /// Returns hashCode for enum UsageUnit + /// The hashCode of the value + public override int GetHashCode() + { + return this._value.GetHashCode(); + } + + /// Returns string representation for UsageUnit + /// A string for this value. + public override string ToString() + { + return this._value; + } + + /// Creates an instance of the Enum class. + /// the value to create an instance for. + private UsageUnit(string underlyingValue) + { + this._value = underlyingValue; + } + + /// Implicit operator to convert string to UsageUnit + /// the value to convert to an instance of . + + public static implicit operator UsageUnit(string value) + { + return new UsageUnit(value); + } + + /// Implicit operator to convert UsageUnit to string + /// the value to convert to an instance of . + + public static implicit operator string(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit e) + { + return e._value; + } + + /// Overriding != operator for enum UsageUnit + /// the value to compare against + /// the value to compare against + /// true if the two instances are not equal to the same value + public static bool operator !=(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit e2) + { + return !e2.Equals(e1); + } + + /// Overriding == operator for enum UsageUnit + /// the value to compare against + /// the value to compare against + /// true if the two instances are equal to the same value + public static bool operator ==(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit e1, Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.UsageUnit e2) + { + return e2.Equals(e1); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_Clear.cs b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_Clear.cs new file mode 100644 index 000000000000..d686b2623f93 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_Clear.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears + /// out only the specified tags in the request. + /// + /// + /// [OpenAPI] ClearLegalHold=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorageBlobContainerLegalHold_Clear", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class ClearAzStorageBlobContainerLegalHold_Clear : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold _legalHold; + + /// The LegalHold property of a blob container. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The LegalHold property of a blob container.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The LegalHold property of a blob container.", + SerializedName = @"legalHold", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold LegalHold { get => this._legalHold; set => this._legalHold = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorageBlobContainerLegalHold_Clear() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersClearLegalHold' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersClearLegalHold(ResourceGroupName, AccountName, ContainerName, SubscriptionId, LegalHold, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,body=LegalHold}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearExpanded.cs b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearExpanded.cs new file mode 100644 index 000000000000..86bd6637b9d5 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearExpanded.cs @@ -0,0 +1,406 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears + /// out only the specified tags in the request. + /// + /// + /// [OpenAPI] ClearLegalHold=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorageBlobContainerLegalHold_ClearExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class ClearAzStorageBlobContainerLegalHold_ClearExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The LegalHold property of a blob container. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold _legalHoldBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHold(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWritesAll { get => _legalHoldBody.AllowProtectedAppendWritesAll ?? default(global::System.Management.Automation.SwitchParameter); set => _legalHoldBody.AllowProtectedAppendWritesAll = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + public string[] Tag { get => _legalHoldBody.Tag ?? null /* arrayOf */; set => _legalHoldBody.Tag = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorageBlobContainerLegalHold_ClearExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersClearLegalHold' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersClearLegalHold(ResourceGroupName, AccountName, ContainerName, SubscriptionId, _legalHoldBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,body=_legalHoldBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentity.cs b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentity.cs new file mode 100644 index 000000000000..235946daabf6 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentity.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears + /// out only the specified tags in the request. + /// + /// + /// [OpenAPI] ClearLegalHold=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorageBlobContainerLegalHold_ClearViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class ClearAzStorageBlobContainerLegalHold_ClearViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold _legalHold; + + /// The LegalHold property of a blob container. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The LegalHold property of a blob container.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The LegalHold property of a blob container.", + SerializedName = @"legalHold", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold LegalHold { get => this._legalHold; set => this._legalHold = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorageBlobContainerLegalHold_ClearViaIdentity() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersClearLegalHold' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersClearLegalHoldViaIdentity(InputObject.Id, LegalHold, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersClearLegalHold(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, LegalHold, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=LegalHold}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded.cs new file mode 100644 index 000000000000..08b900c70913 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded.cs @@ -0,0 +1,369 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears + /// out only the specified tags in the request. + /// + /// + /// [OpenAPI] ClearLegalHold=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/clearLegalHold" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Clear, @"AzStorageBlobContainerLegalHold_ClearViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Clears legal hold tags. Clearing the same or non-existent tag results in an idempotent operation. ClearLegalHold clears out only the specified tags in the request.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The LegalHold property of a blob container. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold _legalHoldBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LegalHold(); + + /// + /// When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. + /// Only new blocks can be added and any existing blocks cannot be modified or deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining legal hold protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWritesAll { get => _legalHoldBody.AllowProtectedAppendWritesAll ?? default(global::System.Management.Automation.SwitchParameter); set => _legalHoldBody.AllowProtectedAppendWritesAll = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Each tag should be 3 to 23 alphanumeric characters and is normalized to lower case at SRP.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(string) })] + public string[] Tag { get => _legalHoldBody.Tag ?? null /* arrayOf */; set => _legalHoldBody.Tag = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public ClearAzStorageBlobContainerLegalHold_ClearViaIdentityExpanded() + { + + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersClearLegalHold' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersClearLegalHoldViaIdentity(InputObject.Id, _legalHoldBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersClearLegalHold(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, _legalHoldBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_legalHoldBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILegalHold + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccountKey_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountKey_List.cs new file mode 100644 index 000000000000..c81db423e6c3 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountKey_List.cs @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account. + /// + /// + /// [OpenAPI] ListKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/listKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountKey_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists the access keys or Kerberos keys (if active directory enabled) for the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccountKey_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand _expand; + + /// Specifies type of the key to be listed. Possible value is kerb. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies type of the key to be listed. Possible value is kerb.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies type of the key to be listed. Possible value is kerb.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListKeyExpand Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountKey_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsListKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListKeys(ResourceGroupName, AccountName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / keys / + WriteObject((await response).Key, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccountProperty_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountProperty_Get.cs new file mode 100644 index 000000000000..1a8290065b4f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountProperty_Get.cs @@ -0,0 +1,375 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account + /// status. The ListKeys operation should be used to retrieve storage keys. + /// + /// + /// [OpenAPI] GetProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountProperty_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccountProperty_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand _expand; + + /// + /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. + /// Currently we only support geoReplicationStats and blobRestoreStatus. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountProperty_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsGetProperties(ResourceGroupName, AccountName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccountProperty_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..79d0282e2863 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountProperty_GetViaIdentity.cs @@ -0,0 +1,349 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account + /// status. The ListKeys operation should be used to retrieve storage keys. + /// + /// + /// [OpenAPI] GetProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountProperty_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Returns the properties for the specified storage account including but not limited to name, SKU name, location, and account status. The ListKeys operation should be used to retrieve storage keys.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccountProperty_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand _expand; + + /// + /// May be used to expand the properties within account's properties. By default, data is not included when fetching properties. + /// Currently we only support geoReplicationStats and blobRestoreStatus. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"May be used to expand the properties within account's properties. By default, data is not included when fetching properties. Currently we only support geoReplicationStats and blobRestoreStatus.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.StorageAccountExpand Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountProperty_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsGetPropertiesViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsGetProperties(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccountSas_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountSas_List.cs new file mode 100644 index 000000000000..8b30f72ca67f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountSas_List.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List SAS credentials of a storage account. + /// + /// [OpenAPI] ListAccountSAS=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountSas_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List SAS credentials of a storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccountSas_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters _parameter; + + /// The parameters to list SAS credentials of a storage account. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters to list SAS credentials of a storage account.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters to list SAS credentials of a storage account.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountSas_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsListAccountSas' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListAccountSas(ResourceGroupName, AccountName, SubscriptionId, Parameter, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse + WriteObject((await response).AccountSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccountSas_ListExpanded.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountSas_ListExpanded.cs new file mode 100644 index 000000000000..8917fc43887a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountSas_ListExpanded.cs @@ -0,0 +1,461 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List SAS credentials of a storage account. + /// + /// [OpenAPI] ListAccountSAS=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListAccountSas" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountSas_ListExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List SAS credentials of a storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccountSas_ListExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The parameters to list SAS credentials of a storage account. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IAccountSasParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.AccountSasParameters(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// An IP address or a range of IP addresses from which to accept requests. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An IP address or a range of IP addresses from which to accept requests.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An IP address or a range of IP addresses from which to accept requests.", + SerializedName = @"signedIp", + PossibleTypes = new [] { typeof(string) })] + public string IPAddressOrRange { get => _parametersBody.IPAddressOrRange ?? null; set => _parametersBody.IPAddressOrRange = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The key to sign the account SAS token with. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The key to sign the account SAS token with.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key to sign the account SAS token with.", + SerializedName = @"keyToSign", + PossibleTypes = new [] { typeof(string) })] + public string KeyToSign { get => _parametersBody.KeyToSign ?? null; set => _parametersBody.KeyToSign = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).", + SerializedName = @"signedPermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions Permission { get => _parametersBody.Permission; set => _parametersBody.Permission = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The protocol permitted for a request made with the account SAS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The protocol permitted for a request made with the account SAS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The protocol permitted for a request made with the account SAS.", + SerializedName = @"signedProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol Protocol { get => _parametersBody.Protocol ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol)""); set => _parametersBody.Protocol = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// + /// The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container + /// (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, + /// and files. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files.", + SerializedName = @"signedResourceTypes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResourceTypes ResourceType { get => _parametersBody.ResourceType; set => _parametersBody.ResourceType = value; } + + /// + /// The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f). + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The signed services accessible with the account SAS. Possible values include: Blob (b), Queue (q), Table (t), File (f).", + SerializedName = @"signedServices", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Services Service { get => _parametersBody.Service; set => _parametersBody.Service = value; } + + /// The time at which the shared access signature becomes invalid. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The time at which the shared access signature becomes invalid.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The time at which the shared access signature becomes invalid.", + SerializedName = @"signedExpiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime SharedAccessExpiryTime { get => _parametersBody.SharedAccessExpiryTime; set => _parametersBody.SharedAccessExpiryTime = value; } + + /// The time at which the SAS becomes valid. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time at which the SAS becomes valid.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which the SAS becomes valid.", + SerializedName = @"signedStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime SharedAccessStartTime { get => _parametersBody.SharedAccessStartTime ?? default(global::System.DateTime); set => _parametersBody.SharedAccessStartTime = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountSas_ListExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsListAccountSas' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListAccountSas(ResourceGroupName, AccountName, SubscriptionId, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListAccountSasResponse + WriteObject((await response).AccountSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccountServiceSas_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountServiceSas_List.cs new file mode 100644 index 000000000000..b9546d462f59 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountServiceSas_List.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List service SAS credentials of a specific resource. + /// + /// [OpenAPI] ListServiceSAS=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountServiceSas_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List service SAS credentials of a specific resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccountServiceSas_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters _parameter; + + /// The parameters to list service SAS credentials of a specific resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters to list service SAS credentials of a specific resource.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters to list service SAS credentials of a specific resource.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountServiceSas_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsListServiceSas' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListServiceSas(ResourceGroupName, AccountName, SubscriptionId, Parameter, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse + WriteObject((await response).ServiceSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccountServiceSas_ListExpanded.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountServiceSas_ListExpanded.cs new file mode 100644 index 000000000000..c9b59c091979 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccountServiceSas_ListExpanded.cs @@ -0,0 +1,570 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List service SAS credentials of a specific resource. + /// + /// [OpenAPI] ListServiceSAS=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/ListServiceSas" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccountServiceSas_ListExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List service SAS credentials of a specific resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccountServiceSas_ListExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The parameters to list service SAS credentials of a specific resource. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IServiceSasParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ServiceSasParameters(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The response header override for cache control. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The response header override for cache control.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for cache control.", + SerializedName = @"rscc", + PossibleTypes = new [] { typeof(string) })] + public string CacheControl { get => _parametersBody.CacheControl ?? null; set => _parametersBody.CacheControl = value; } + + /// The canonical path to the signed resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The canonical path to the signed resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The canonical path to the signed resource.", + SerializedName = @"canonicalizedResource", + PossibleTypes = new [] { typeof(string) })] + public string CanonicalizedResource { get => _parametersBody.CanonicalizedResource ?? null; set => _parametersBody.CanonicalizedResource = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// The response header override for content disposition. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The response header override for content disposition.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content disposition.", + SerializedName = @"rscd", + PossibleTypes = new [] { typeof(string) })] + public string ContentDisposition { get => _parametersBody.ContentDisposition ?? null; set => _parametersBody.ContentDisposition = value; } + + /// The response header override for content encoding. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The response header override for content encoding.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content encoding.", + SerializedName = @"rsce", + PossibleTypes = new [] { typeof(string) })] + public string ContentEncoding { get => _parametersBody.ContentEncoding ?? null; set => _parametersBody.ContentEncoding = value; } + + /// The response header override for content language. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The response header override for content language.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content language.", + SerializedName = @"rscl", + PossibleTypes = new [] { typeof(string) })] + public string ContentLanguage { get => _parametersBody.ContentLanguage ?? null; set => _parametersBody.ContentLanguage = value; } + + /// The response header override for content type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The response header override for content type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The response header override for content type.", + SerializedName = @"rsct", + PossibleTypes = new [] { typeof(string) })] + public string ContentType { get => _parametersBody.ContentType ?? null; set => _parametersBody.ContentType = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// An IP address or a range of IP addresses from which to accept requests. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "An IP address or a range of IP addresses from which to accept requests.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"An IP address or a range of IP addresses from which to accept requests.", + SerializedName = @"signedIp", + PossibleTypes = new [] { typeof(string) })] + public string IPAddressOrRange { get => _parametersBody.IPAddressOrRange ?? null; set => _parametersBody.IPAddressOrRange = value; } + + /// + /// A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or + /// table. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table.", + SerializedName = @"signedIdentifier", + PossibleTypes = new [] { typeof(string) })] + public string Identifier { get => _parametersBody.Identifier ?? null; set => _parametersBody.Identifier = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// The key to sign the account SAS token with. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The key to sign the account SAS token with.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key to sign the account SAS token with.", + SerializedName = @"keyToSign", + PossibleTypes = new [] { typeof(string) })] + public string KeyToSign { get => _parametersBody.KeyToSign ?? null; set => _parametersBody.KeyToSign = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The end of partition key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end of partition key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end of partition key.", + SerializedName = @"endPk", + PossibleTypes = new [] { typeof(string) })] + public string PartitionKeyEnd { get => _parametersBody.PartitionKeyEnd ?? null; set => _parametersBody.PartitionKeyEnd = value; } + + /// The start of partition key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start of partition key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start of partition key.", + SerializedName = @"startPk", + PossibleTypes = new [] { typeof(string) })] + public string PartitionKeyStart { get => _parametersBody.PartitionKeyStart ?? null; set => _parametersBody.PartitionKeyStart = value; } + + /// + /// The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), + /// Create (c), Update (u) and Process (p). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p).", + SerializedName = @"signedPermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions Permission { get => _parametersBody.Permission ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Permissions)""); set => _parametersBody.Permission = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The protocol permitted for a request made with the account SAS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The protocol permitted for a request made with the account SAS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The protocol permitted for a request made with the account SAS.", + SerializedName = @"signedProtocol", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol Protocol { get => _parametersBody.Protocol ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.HttpProtocol)""); set => _parametersBody.Protocol = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share + /// (s). + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s).", + SerializedName = @"signedResource", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource Resource { get => _parametersBody.Resource ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SignedResource)""); set => _parametersBody.Resource = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The end of row key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The end of row key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The end of row key.", + SerializedName = @"endRk", + PossibleTypes = new [] { typeof(string) })] + public string RowKeyEnd { get => _parametersBody.RowKeyEnd ?? null; set => _parametersBody.RowKeyEnd = value; } + + /// The start of row key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The start of row key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The start of row key.", + SerializedName = @"startRk", + PossibleTypes = new [] { typeof(string) })] + public string RowKeyStart { get => _parametersBody.RowKeyStart ?? null; set => _parametersBody.RowKeyStart = value; } + + /// The time at which the shared access signature becomes invalid. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time at which the shared access signature becomes invalid.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which the shared access signature becomes invalid.", + SerializedName = @"signedExpiry", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime SharedAccessExpiryTime { get => _parametersBody.SharedAccessExpiryTime ?? default(global::System.DateTime); set => _parametersBody.SharedAccessExpiryTime = value; } + + /// The time at which the SAS becomes valid. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The time at which the SAS becomes valid.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The time at which the SAS becomes valid.", + SerializedName = @"signedStart", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime SharedAccessStartTime { get => _parametersBody.SharedAccessStartTime ?? default(global::System.DateTime); set => _parametersBody.SharedAccessStartTime = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccountServiceSas_ListExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsListServiceSas' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListServiceSas(ResourceGroupName, AccountName, SubscriptionId, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListServiceSasResponse + WriteObject((await response).ServiceSasToken); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccount_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccount_List.cs new file mode 100644 index 000000000000..498465064a92 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccount_List.cs @@ -0,0 +1,346 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys + /// operation for this. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccount_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all the storage accounts available under the subscription. Note that storage keys are not returned; use the ListKeys operation for this.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccount_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccount_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsList(SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsList_Call(requestMessage, onOk, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageAccount_List1.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageAccount_List1.cs new file mode 100644 index 000000000000..735ce37a906e --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageAccount_List1.cs @@ -0,0 +1,362 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use + /// the ListKeys operation for this. + /// + /// + /// [OpenAPI] ListByResourceGroup=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageAccount_List1")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all the storage accounts available under the given resource group. Note that storage keys are not returned; use the ListKeys operation for this.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageAccount_List1 : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageAccount_List1() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListByResourceGroup(ResourceGroupName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsListByResourceGroup_Call(requestMessage, onOk, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_Get.cs new file mode 100644 index 000000000000..790bf84a1c1a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_Get.cs @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the existing immutability policy along with the corresponding ETag in response headers and body. + /// + /// + /// [OpenAPI] GetImmutabilityPolicy=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobContainerImmutabilityPolicy_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the existing immutability policy along with the corresponding ETag in response headers and body.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobContainerImmutabilityPolicy_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobContainerImmutabilityPolicy_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersGetImmutabilityPolicy(ResourceGroupName, AccountName, ContainerName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..64d321020ec7 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainerImmutabilityPolicy_GetViaIdentity.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the existing immutability policy along with the corresponding ETag in response headers and body. + /// + /// + /// [OpenAPI] GetImmutabilityPolicy=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobContainerImmutabilityPolicy_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the existing immutability policy along with the corresponding ETag in response headers and body.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobContainerImmutabilityPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobContainerImmutabilityPolicy_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersGetImmutabilityPolicyViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersGetImmutabilityPolicy(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_Get.cs new file mode 100644 index 000000000000..a69016d91dc1 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_Get.cs @@ -0,0 +1,372 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets properties of a specified container. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobContainer_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified container. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobContainer_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobContainer_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersGet(ResourceGroupName, AccountName, ContainerName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_GetViaIdentity.cs new file mode 100644 index 000000000000..065ee9d41927 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_GetViaIdentity.cs @@ -0,0 +1,332 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets properties of a specified container. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobContainer_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified container. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobContainer_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobContainer_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_List.cs new file mode 100644 index 000000000000..99aec163f650 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobContainer_List.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobContainer_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItem))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all containers and does not support a prefix like data plane. Also SRP today does not return continuation token.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobContainer_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Optional. When specified, only container names starting with the filter will be listed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. When specified, only container names starting with the filter will be listed.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. When specified, only container names starting with the filter will be listed.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude _include; + + /// Optional, used to include the properties for soft deleted blob containers. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to include the properties for soft deleted blob containers.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to include the properties for soft deleted blob containers.", + SerializedName = @"$include", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ListContainersInclude Include { get => this._include; set => this._include = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _maxpagesize; + + /// + /// Optional. Specified maximum number of containers that can be included in the list. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Specified maximum number of containers that can be included in the list.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Specified maximum number of containers that can be included in the list.", + SerializedName = @"$maxpagesize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Maxpagesize { get => this._maxpagesize; set => this._maxpagesize = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobContainer_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersList(ResourceGroupName, AccountName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Include=this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListContainerItems + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersList_Call(requestMessage, onOk, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_Get.cs new file mode 100644 index 000000000000..2118d16637b9 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_Get.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets the blob inventory policy associated with the specified storage account. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobInventoryPolicy_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the blob inventory policy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobInventoryPolicy_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobInventoryPolicy_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobInventoryPoliciesGet(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..6dea37bc2d1f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets the blob inventory policy associated with the specified storage account. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobInventoryPolicy_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the blob inventory policy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobInventoryPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobInventoryPolicy_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobInventoryPoliciesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobInventoryPoliciesGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_List.cs new file mode 100644 index 000000000000..e56b8195d456 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobInventoryPolicy_List.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets the blob inventory policy associated with the specified storage account. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobInventoryPolicy_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the blob inventory policy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobInventoryPolicy_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobInventoryPolicy_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobInventoryPoliciesList(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListBlobInventoryPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobServiceProperty_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobServiceProperty_Get.cs new file mode 100644 index 000000000000..4c7bff8ae6a6 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobServiceProperty_Get.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobServiceProperty_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobServiceProperty_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobServiceProperty_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobServicesGetServiceProperties(ResourceGroupName, AccountName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobServiceProperty_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..fa3c4ee6cebc --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobServiceProperty_GetViaIdentity.cs @@ -0,0 +1,331 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/{BlobServicesName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobServiceProperty_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobServiceProperty_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobServiceProperty_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobServicesGetServicePropertiesViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobServicesGetServiceProperties(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageBlobService_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobService_List.cs new file mode 100644 index 000000000000..0bb812834ff3 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageBlobService_List.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// List blob services of storage account. It returns a collection of one object named default. + /// + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageBlobService_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List blob services of storage account. It returns a collection of one object named default.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageBlobService_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageBlobService_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobServicesList(ResourceGroupName, AccountName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobServiceItems + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_Get.cs new file mode 100644 index 000000000000..09ca58bb253c --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_Get.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Get properties of specified deleted account resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageDeletedAccount_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get properties of specified deleted account resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageDeletedAccount_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// The location of the deleted storage account. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The location of the deleted storage account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The location of the deleted storage account.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// Name of the deleted storage account. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Name of the deleted storage account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Name of the deleted storage account.", + SerializedName = @"deletedAccountName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("DeletedAccountName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageDeletedAccount_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DeletedAccountsGet(Name, Location, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name,Location=Location,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, Location=Location, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Name=Name, Location=Location, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_GetViaIdentity.cs new file mode 100644 index 000000000000..56185dd3a2f4 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_GetViaIdentity.cs @@ -0,0 +1,382 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Get properties of specified deleted account resource. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/deletedAccounts/{deletedAccountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageDeletedAccount_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get properties of specified deleted account resource.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageDeletedAccount_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageDeletedAccount_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.DeletedAccountsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.DeletedAccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.DeletedAccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Location) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Location"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.DeletedAccountsGet(InputObject.DeletedAccountName ?? null, InputObject.Location ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_List.cs new file mode 100644 index 000000000000..ef8ec72cd51c --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageDeletedAccount_List.cs @@ -0,0 +1,397 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Lists deleted accounts under the subscription. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/deletedAccounts" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageDeletedAccount_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists deleted accounts under the subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageDeletedAccount_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageDeletedAccount_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DeletedAccountsList(SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedAccountListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.DeletedAccountsList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_Get.cs new file mode 100644 index 000000000000..9a2c5ef04400 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_Get.cs @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Returns the properties for the specified encryption scope. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageEncryptionScope_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Returns the properties for the specified encryption scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageEncryptionScope_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 + /// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately + /// preceded and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"encryptionScopeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EncryptionScopeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageEncryptionScope_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EncryptionScopesGet(ResourceGroupName, AccountName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_GetViaIdentity.cs new file mode 100644 index 000000000000..b43c94a6fbf6 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Returns the properties for the specified encryption scope. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageEncryptionScope_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Returns the properties for the specified encryption scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageEncryptionScope_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageEncryptionScope_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EncryptionScopesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EncryptionScopeName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EncryptionScopeName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EncryptionScopesGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.EncryptionScopeName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_List.cs new file mode 100644 index 000000000000..fa612b6ef682 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageEncryptionScope_List.cs @@ -0,0 +1,376 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Lists all the encryption scopes available under the specified storage account. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageEncryptionScope_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all the encryption scopes available under the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageEncryptionScope_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageEncryptionScope_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EncryptionScopesList(ResourceGroupName, AccountName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScopeListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EncryptionScopesList_Call(requestMessage, onOk, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageFileServiceProperty_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageFileServiceProperty_Get.cs new file mode 100644 index 000000000000..c6808bb35f9e --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageFileServiceProperty_Get.cs @@ -0,0 +1,410 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageFileServiceProperty_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageFileServiceProperty_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageFileServiceProperty_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServicesGetServiceProperties(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageFileServiceProperty_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageFileServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..e32696c278b0 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageFileServiceProperty_GetViaIdentity.cs @@ -0,0 +1,384 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/{FileServicesName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageFileServiceProperty_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of file services in storage accounts, including CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageFileServiceProperty_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageFileServiceProperty_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileServicesGetServicePropertiesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileServicesGetServiceProperties(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageFileService_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageFileService_List.cs new file mode 100644 index 000000000000..7244736eeefa --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageFileService_List.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List all file services in storage accounts + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageFileService_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all file services in storage accounts")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageFileService_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageFileService_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileServicesList(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileServiceItems + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_Get.cs new file mode 100644 index 000000000000..6ac5763f2611 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_Get.cs @@ -0,0 +1,457 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets properties of a specified share. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageFileShare_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageFileShare_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string + /// with delimiter ','. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string with delimiter ','.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string with delimiter ','.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional, used to retrieve properties of a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to retrieve properties of a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to retrieve properties of a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageFileShare_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesGet(ResourceGroupName, AccountName, ShareName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,SubscriptionId=SubscriptionId,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_GetViaIdentity.cs new file mode 100644 index 000000000000..82d082f32af1 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_GetViaIdentity.cs @@ -0,0 +1,417 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets properties of a specified share. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageFileShare_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets properties of a specified share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageFileShare_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string + /// with delimiter ','. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string with delimiter ','.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to expand the properties within share's properties. Valid values are: stats. Should be passed as a string with delimiter ','.", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional, used to retrieve properties of a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to retrieve properties of a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to retrieve properties of a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageFileShare_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesGetViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_List.cs new file mode 100644 index 000000000000..3fef106a3b47 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageFileShare_List.cs @@ -0,0 +1,477 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Lists all shares. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageFileShare_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItem))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all shares.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageFileShare_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. Should be passed + /// as a string with delimiter ',' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. Should be passed as a string with delimiter ','")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. Should be passed as a string with delimiter ','", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// Backing field for property. + private string _filter; + + /// + /// Optional. When specified, only share names starting with the filter will be listed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. When specified, only share names starting with the filter will be listed.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. When specified, only share names starting with the filter will be listed.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _maxpagesize; + + /// Optional. Specified maximum number of shares that can be included in the list. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Specified maximum number of shares that can be included in the list.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Specified maximum number of shares that can be included in the list.", + SerializedName = @"$maxpagesize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Maxpagesize { get => this._maxpagesize; set => this._maxpagesize = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageFileShare_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesList(ResourceGroupName, AccountName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShareItems + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUserKey_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUserKey_List.cs new file mode 100644 index 000000000000..cdbedbcb8f8e --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUserKey_List.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List SSH authorized keys and shared key of the local user. + /// + /// [OpenAPI] ListKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/listKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageLocalUserKey_List", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List SSH authorized keys and shared key of the local user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageLocalUserKey_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _username; + + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Username { get => this._username; set => this._username = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageLocalUserKey_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LocalUsersListKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LocalUsersListKeys(ResourceGroupName, AccountName, SubscriptionId, Username, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Username=Username}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserKeys + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_Get.cs new file mode 100644 index 000000000000..c9293ccf5a5b --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_Get.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Get the local user of the storage account by username. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageLocalUser_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get the local user of the storage account by username.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageLocalUser_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _username; + + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Username { get => this._username; set => this._username = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageLocalUser_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LocalUsersGet(ResourceGroupName, AccountName, SubscriptionId, Username, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Username=Username}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_GetViaIdentity.cs new file mode 100644 index 000000000000..a28436e4273c --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Get the local user of the storage account by username. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageLocalUser_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get the local user of the storage account by username.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageLocalUser_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageLocalUser_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.LocalUsersGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Username) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Username"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.LocalUsersGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.Username ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_List.cs new file mode 100644 index 000000000000..9f775487066d --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageLocalUser_List.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List the local users associated with the storage account. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageLocalUser_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List the local users associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageLocalUser_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageLocalUser_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LocalUsersList(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUsers + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageManagementPolicy_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageManagementPolicy_Get.cs new file mode 100644 index 000000000000..b5c3c57631b3 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageManagementPolicy_Get.cs @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets the managementpolicy associated with the specified storage account. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageManagementPolicy_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the managementpolicy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageManagementPolicy_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageManagementPolicy_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagementPoliciesGet(ResourceGroupName, AccountName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageManagementPolicy_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageManagementPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..cb43ebb4df52 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageManagementPolicy_GetViaIdentity.cs @@ -0,0 +1,328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets the managementpolicy associated with the specified storage account. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageManagementPolicy_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the managementpolicy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageManagementPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageManagementPolicy_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagementPoliciesGetViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagementPoliciesGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_Get.cs new file mode 100644 index 000000000000..f5d5f74022b2 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_Get.cs @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Get the object replication policy of the storage account by policy ID. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageObjectReplicationPolicy_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get the object replication policy of the storage account by policy ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageObjectReplicationPolicy_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// + /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the + /// source account, provide the value of the policy ID that is returned when you download the policy that was defined on the + /// destination account. The policy is downloaded as a JSON file. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file.", + SerializedName = @"objectReplicationPolicyId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ObjectReplicationPolicyId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageObjectReplicationPolicy_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ObjectReplicationPoliciesGet(ResourceGroupName, AccountName, SubscriptionId, Id, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Id=Id }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Id=Id }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_GetViaIdentity.cs new file mode 100644 index 000000000000..88d424588ae5 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_GetViaIdentity.cs @@ -0,0 +1,386 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Get the object replication policy of the storage account by policy ID. + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageObjectReplicationPolicy_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Get the object replication policy of the storage account by policy ID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageObjectReplicationPolicy_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageObjectReplicationPolicy_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ObjectReplicationPoliciesGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ObjectReplicationPolicyId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ObjectReplicationPolicyId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ObjectReplicationPoliciesGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.ObjectReplicationPolicyId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_List.cs new file mode 100644 index 000000000000..731c5ed42165 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageObjectReplicationPolicy_List.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List the object replication policies associated with the storage account. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageObjectReplicationPolicy_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List the object replication policies associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageObjectReplicationPolicy_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageObjectReplicationPolicy_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ObjectReplicationPoliciesList(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicies + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageOperation_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageOperation_List.cs new file mode 100644 index 000000000000..e17317555976 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageOperation_List.cs @@ -0,0 +1,302 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Lists all of the available Storage Rest API operations. + /// + /// [OpenAPI] List=>GET:"/providers/Microsoft.Storage/operations" + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.InternalExport] + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageOperation_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists all of the available Storage Rest API operations.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageOperation_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageOperation_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.OperationsList(onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperationListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_Get.cs new file mode 100644 index 000000000000..0be6a9027c09 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_Get.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the specified private endpoint connection associated with the storage account. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStoragePrivateEndpointConnection_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the specified private endpoint connection associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStoragePrivateEndpointConnection_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStoragePrivateEndpointConnection_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsGet(ResourceGroupName, AccountName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_GetViaIdentity.cs new file mode 100644 index 000000000000..5fbd635ea11e --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_GetViaIdentity.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the specified private endpoint connection associated with the storage account. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStoragePrivateEndpointConnection_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the specified private endpoint connection associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStoragePrivateEndpointConnection_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStoragePrivateEndpointConnection_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PrivateEndpointConnectionsGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateEndpointConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PrivateEndpointConnectionsGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_List.cs new file mode 100644 index 000000000000..99b1a4198713 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateEndpointConnection_List.cs @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List all the private endpoint connections associated with the storage account. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStoragePrivateEndpointConnection_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnection))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all the private endpoint connections associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStoragePrivateEndpointConnection_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStoragePrivateEndpointConnection_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsList(ResourceGroupName, AccountName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateEndpointConnectionListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateLinkResource_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateLinkResource_List.cs new file mode 100644 index 000000000000..bb2bb4a84c93 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStoragePrivateLinkResource_List.cs @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets the private link resources that need to be created for a storage account. + /// + /// [OpenAPI] ListByStorageAccount=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateLinkResources" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStoragePrivateLinkResource_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResource))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the private link resources that need to be created for a storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStoragePrivateLinkResource_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStoragePrivateLinkResource_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateLinkResourcesListByStorageAccount(ResourceGroupName, AccountName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPrivateLinkResourceListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageQueueServiceProperty_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageQueueServiceProperty_Get.cs new file mode 100644 index 000000000000..b0cd1e8e303b --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageQueueServiceProperty_Get.cs @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageQueueServiceProperty_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageQueueServiceProperty_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageQueueServiceProperty_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueServicesGetServiceProperties(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageQueueServiceProperty_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageQueueServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..0321479db38c --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageQueueServiceProperty_GetViaIdentity.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageQueueServiceProperty_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of a storage account’s Queue service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageQueueServiceProperty_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageQueueServiceProperty_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueueServicesGetServicePropertiesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueueServicesGetServiceProperties(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageQueueService_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageQueueService_List.cs new file mode 100644 index 000000000000..761112499f8a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageQueueService_List.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List all queue services for the storage account + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageQueueService_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueueServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all queue services for the storage account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageQueueService_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageQueueService_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueServicesList(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueServices + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_Get.cs new file mode 100644 index 000000000000..5271ae128c9b --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_Get.cs @@ -0,0 +1,429 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the queue with the specified queue name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageQueue_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the queue with the specified queue name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageQueue_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot + /// have two consecutive dash(-) characters. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.", + SerializedName = @"queueName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("QueueName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageQueue_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueGet(ResourceGroupName, AccountName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_GetViaIdentity.cs new file mode 100644 index 000000000000..440a482475db --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_GetViaIdentity.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the queue with the specified queue name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageQueue_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the queue with the specified queue name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageQueue_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageQueue_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueueGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.QueueName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.QueueName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueueGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.QueueName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_List.cs new file mode 100644 index 000000000000..11bab6d12841 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageQueue_List.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets a list of all the queues under the specified storage account + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageQueue_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueue))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets a list of all the queues under the specified storage account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageQueue_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _filter; + + /// + /// Optional, When specified, only the queues with a name starting with the given filter will be listed. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, When specified, only the queues with a name starting with the given filter will be listed.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, When specified, only the queues with a name starting with the given filter will be listed.", + SerializedName = @"$filter", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Filter { get => this._filter; set => this._filter = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _maxpagesize; + + /// + /// Optional, a maximum number of queues that should be included in a list queue response + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, a maximum number of queues that should be included in a list queue response")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, a maximum number of queues that should be included in a list queue response", + SerializedName = @"$maxpagesize", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Maxpagesize { get => this._maxpagesize; set => this._maxpagesize = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageQueue_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueList(ResourceGroupName, AccountName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null, this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null,Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Maxpagesize=this.InvocationInformation.BoundParameters.ContainsKey("Maxpagesize") ? Maxpagesize : null, Filter=this.InvocationInformation.BoundParameters.ContainsKey("Filter") ? Filter : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListQueueResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageSku_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageSku_List.cs new file mode 100644 index 000000000000..89e04f1be6c5 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageSku_List.cs @@ -0,0 +1,322 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Lists the available SKUs supported by Microsoft.Storage for given subscription. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/skus" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageSku_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISkuInformation))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Lists the available SKUs supported by Microsoft.Storage for given subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageSku_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageSku_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.SkusList(SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageSkuListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageTableServiceProperty_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageTableServiceProperty_Get.cs new file mode 100644 index 000000000000..6c3dd652cd1a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageTableServiceProperty_Get.cs @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTableServiceProperty_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageTableServiceProperty_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTableServiceProperty_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableServicesGetServiceProperties(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageTableServiceProperty_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageTableServiceProperty_GetViaIdentity.cs new file mode 100644 index 000000000000..f67dab4cd918 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageTableServiceProperty_GetViaIdentity.cs @@ -0,0 +1,385 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin + /// Resource Sharing) rules. + /// + /// + /// [OpenAPI] GetServiceProperties=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTableServiceProperty_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the properties of a storage account’s Table service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageTableServiceProperty_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTableServiceProperty_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TableServicesGetServicePropertiesViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TableServicesGetServiceProperties(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageTableService_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageTableService_List.cs new file mode 100644 index 000000000000..59135aa33ae0 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageTableService_List.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// List all table services for the storage account. + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTableService_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableServiceProperties))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"List all table services for the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageTableService_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTableService_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableServicesList(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableServices + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageTable_Get.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageTable_Get.cs new file mode 100644 index 000000000000..dcf06887c218 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageTable_Get.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the table with the specified table name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTable_Get")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the table with the specified table name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageTable_Get : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// only alphanumeric characters and it cannot begin with a numeric character. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TableName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTable_Get() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableGet(ResourceGroupName, AccountName, SubscriptionId, Name, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageTable_GetViaIdentity.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageTable_GetViaIdentity.cs new file mode 100644 index 000000000000..a2e220c72866 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageTable_GetViaIdentity.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the table with the specified table name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Get=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTable_GetViaIdentity")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the table with the specified table name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageTable_GetViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTable_GetViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TableGetViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TableName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TableName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TableGet(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.TableName ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageTable_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageTable_List.cs new file mode 100644 index 000000000000..cc6490b837d5 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageTable_List.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Gets a list of all the tables under the specified storage account + /// + /// [OpenAPI] List=>GET:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageTable_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets a list of all the tables under the specified storage account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageTable_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// A flag to tell whether it is the first onOK call. + private bool _isFirst = true; + + /// Link to retrieve next page. + private string _nextLink; + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageTable_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableList(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IListTableResource + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / nextLink + var result = await response; + WriteObject(result.Value,true); + _nextLink = result.NextLink; + if (_isFirst) + { + _isFirst = false; + while (_nextLink != null) + { + if (responseMessage.RequestMessage is System.Net.Http.HttpRequestMessage requestMessage ) + { + requestMessage = requestMessage.Clone(new global::System.Uri( _nextLink ),Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Method.Get ); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.FollowingNextLink); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableList_Call(requestMessage, onOk, onDefault, this, Pipeline); + } + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/GetAzStorageUsage_List.cs b/swaggerci/storage/generated/cmdlets/GetAzStorageUsage_List.cs new file mode 100644 index 000000000000..35eb0903b00c --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/GetAzStorageUsage_List.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Gets the current usage count and the limit for the resources of the location under the subscription. + /// + /// + /// [OpenAPI] ListByLocation=>GET:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/locations/{location}/usages" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Get, @"AzStorageUsage_List")] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsage))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Gets the current usage count and the limit for the resources of the location under the subscription.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class GetAzStorageUsage_List : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Backing field for property. + private string _location; + + /// The location of the Azure Storage resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The location of the Azure Storage resource.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The location of the Azure Storage resource.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Location { get => this._location; set => this._location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string[] _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string[] SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public GetAzStorageUsage_List() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + foreach( var SubscriptionId in this.SubscriptionId ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.UsagesListByLocation(SubscriptionId, Location, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,Location=Location}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IUsageListResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // pageable / value / + WriteObject((await response).Value, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort.cs new file mode 100644 index 000000000000..86e69231ebf5 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort.cs @@ -0,0 +1,482 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Abort live Migration of storage account to enable Hns + /// + /// [OpenAPI] AbortHierarchicalNamespaceMigration=>POST:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Abort live Migration of storage account to enable Hns")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort Clone() + { + var clone = new InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_Abort() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsAbortHierarchicalNamespaceMigration' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsAbortHierarchicalNamespaceMigration(ResourceGroupName, AccountName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity.cs new file mode 100644 index 000000000000..18f462554155 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Abort live Migration of storage account to enable Hns + /// + /// [OpenAPI] AbortHierarchicalNamespaceMigration=>POST:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/aborthnsonmigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Abort live Migration of storage account to enable Hns")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity Clone() + { + var clone = new InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageAbortStorageAccountHierarchicalNamespaceMigration_AbortViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsAbortHierarchicalNamespaceMigration' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsAbortHierarchicalNamespaceMigrationViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsAbortHierarchicalNamespaceMigration(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend.cs new file mode 100644 index 000000000000..bc207b36e76a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend.cs @@ -0,0 +1,407 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked + /// policy will be this action. ETag in If-Match is required for this operation. + /// + /// + /// [OpenAPI] ExtendImmutabilityPolicy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageExtendBlobContainerImmutabilityPolicy_Extend", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy _parameter; + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageExtendBlobContainerImmutabilityPolicy_Extend() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersExtendImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersExtendImmutabilityPolicy(ResourceGroupName, AccountName, ContainerName, SubscriptionId, IfMatch, Parameter, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,IfMatch=IfMatch,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded.cs new file mode 100644 index 000000000000..ebaeedde47b4 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded.cs @@ -0,0 +1,442 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked + /// policy will be this action. ETag in If-Match is required for this operation. + /// + /// + /// [OpenAPI] ExtendImmutabilityPolicy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWrite { get => _parametersBody.AllowProtectedAppendWrite ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowProtectedAppendWrite = value; } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWritesAll { get => _parametersBody.AllowProtectedAppendWritesAll ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowProtectedAppendWritesAll = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutability period for the blobs in the container since the policy creation, in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + public int ImmutabilityPeriodSinceCreationInDay { get => _parametersBody.ImmutabilityPeriodSinceCreationInDay ?? default(int); set => _parametersBody.ImmutabilityPeriodSinceCreationInDay = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersExtendImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersExtendImmutabilityPolicy(ResourceGroupName, AccountName, ContainerName, SubscriptionId, IfMatch, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,IfMatch=IfMatch,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity.cs new file mode 100644 index 000000000000..70b997e1143f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity.cs @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked + /// policy will be this action. ETag in If-Match is required for this operation. + /// + /// + /// [OpenAPI] ExtendImmutabilityPolicy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy _parameter; + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the + /// cmdlet class. + /// + public InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersExtendImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersExtendImmutabilityPolicyViaIdentity(InputObject.Id, IfMatch, Parameter, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersExtendImmutabilityPolicy(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, IfMatch, Parameter, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=IfMatch,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded.cs new file mode 100644 index 000000000000..96985d6c7964 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked + /// policy will be this action. ETag in If-Match is required for this operation. + /// + /// + /// [OpenAPI] ExtendImmutabilityPolicy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/extend" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Extends the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy. The only action allowed on a Locked policy will be this action. ETag in If-Match is required for this operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy(); + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWrite { get => _parametersBody.AllowProtectedAppendWrite ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowProtectedAppendWrite = value; } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWritesAll { get => _parametersBody.AllowProtectedAppendWritesAll ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowProtectedAppendWritesAll = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutability period for the blobs in the container since the policy creation, in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + public int ImmutabilityPeriodSinceCreationInDay { get => _parametersBody.ImmutabilityPeriodSinceCreationInDay ?? default(int); set => _parametersBody.ImmutabilityPeriodSinceCreationInDay = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageExtendBlobContainerImmutabilityPolicy_ExtendViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersExtendImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersExtendImmutabilityPolicyViaIdentity(InputObject.Id, IfMatch, _parametersBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersExtendImmutabilityPolicy(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, IfMatch, _parametersBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=IfMatch,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical.cs new file mode 100644 index 000000000000..259634956510 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical.cs @@ -0,0 +1,501 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Live Migration of storage account to enable Hns + /// + /// [OpenAPI] HierarchicalNamespaceMigration=>POST:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Live Migration of storage account to enable Hns")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _requestType; + + /// + /// Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' + /// or a hydration request 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration + /// request will migrate the account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration request will migrate the account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration request will migrate the account.", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string RequestType { get => this._requestType; set => this._requestType = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical Clone() + { + var clone = new InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.SubscriptionId = this.SubscriptionId; + clone.RequestType = this.RequestType; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_Hierarchical() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsHierarchicalNamespaceMigration' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsHierarchicalNamespaceMigration(ResourceGroupName, AccountName, SubscriptionId, RequestType, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,RequestType=RequestType}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, RequestType=RequestType }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, RequestType=RequestType }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity.cs new file mode 100644 index 000000000000..820e82b4d7ca --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity.cs @@ -0,0 +1,475 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Live Migration of storage account to enable Hns + /// + /// [OpenAPI] HierarchicalNamespaceMigration=>POST:"/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/hnsonmigration" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Live Migration of storage account to enable Hns")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _requestType; + + /// + /// Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' + /// or a hydration request 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration + /// request will migrate the account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration request will migrate the account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Hierarchical namespace migration type can either be a hierarchical namespace validation request 'HnsOnValidationRequest' or a hydration request 'HnsOnHydrationRequest'. The validation request will validate the migration whereas the hydration request will migrate the account.", + SerializedName = @"requestType", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string RequestType { get => this._requestType; set => this._requestType = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity Clone() + { + var clone = new InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.RequestType = this.RequestType; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageHierarchicalStorageAccountNamespaceMigration_HierarchicalViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsHierarchicalNamespaceMigration' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsHierarchicalNamespaceMigrationViaIdentity(InputObject.Id, RequestType, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsHierarchicalNamespaceMigration(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, RequestType, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RequestType=RequestType}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RequestType=RequestType }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { RequestType=RequestType }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_Lease.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_Lease.cs new file mode 100644 index 000000000000..8c88ea0dbea9 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_Lease.cs @@ -0,0 +1,388 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can + /// be 15 to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseBlobContainer_Lease", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseBlobContainer_Lease : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 _parameter; + + /// Lease Container request schema. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Lease Container request schema.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Lease Container request schema.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseBlobContainer_Lease() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersLease(ResourceGroupName, AccountName, ContainerName, SubscriptionId, Parameter, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseExpanded.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseExpanded.cs new file mode 100644 index 000000000000..629f771932fe --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseExpanded.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can + /// be 15 to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseBlobContainer_LeaseExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseBlobContainer_LeaseExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Lease Container request schema. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseContainerRequest1(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Specifies the lease action. Can be one of the available actions. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specifies the lease action. Can be one of the available actions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the lease action. Can be one of the available actions.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Action { get => _parametersBody.Action; set => _parametersBody.Action = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.", + SerializedName = @"breakPeriod", + PossibleTypes = new [] { typeof(int) })] + public int BreakPeriod { get => _parametersBody.BreakPeriod ?? default(int); set => _parametersBody.BreakPeriod = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(int) })] + public int LeaseDuration { get => _parametersBody.LeaseDuration ?? default(int); set => _parametersBody.LeaseDuration = value; } + + /// Identifies the lease. Can be specified in any valid GUID string format. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifies the lease. Can be specified in any valid GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the lease. Can be specified in any valid GUID string format.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + public string LeaseId { get => _parametersBody.LeaseId ?? null; set => _parametersBody.LeaseId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional for acquire, required for change. Proposed lease ID, in a GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional for acquire, required for change. Proposed lease ID, in a GUID string format.", + SerializedName = @"proposedLeaseId", + PossibleTypes = new [] { typeof(string) })] + public string ProposedLeaseId { get => _parametersBody.ProposedLeaseId ?? null; set => _parametersBody.ProposedLeaseId = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseBlobContainer_LeaseExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersLease(ResourceGroupName, AccountName, ContainerName, SubscriptionId, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity.cs new file mode 100644 index 000000000000..7121829b1eb2 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can + /// be 15 to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseBlobContainer_LeaseViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 _parameter; + + /// Lease Container request schema. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Lease Container request schema.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Lease Container request schema.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseBlobContainer_LeaseViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersLeaseViaIdentity(InputObject.Id, Parameter, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersLease(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded.cs new file mode 100644 index 000000000000..2ca8e1f00697 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can + /// be 15 to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseBlobContainer_LeaseViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Container operation establishes and manages a lock on a container for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Lease Container request schema. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerRequest1 _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseContainerRequest1(); + + /// Specifies the lease action. Can be one of the available actions. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specifies the lease action. Can be one of the available actions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the lease action. Can be one of the available actions.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseContainerRequest Action { get => _parametersBody.Action; set => _parametersBody.Action = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.", + SerializedName = @"breakPeriod", + PossibleTypes = new [] { typeof(int) })] + public int BreakPeriod { get => _parametersBody.BreakPeriod ?? default(int); set => _parametersBody.BreakPeriod = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(int) })] + public int LeaseDuration { get => _parametersBody.LeaseDuration ?? default(int); set => _parametersBody.LeaseDuration = value; } + + /// Identifies the lease. Can be specified in any valid GUID string format. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifies the lease. Can be specified in any valid GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the lease. Can be specified in any valid GUID string format.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + public string LeaseId { get => _parametersBody.LeaseId ?? null; set => _parametersBody.LeaseId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional for acquire, required for change. Proposed lease ID, in a GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional for acquire, required for change. Proposed lease ID, in a GUID string format.", + SerializedName = @"proposedLeaseId", + PossibleTypes = new [] { typeof(string) })] + public string ProposedLeaseId { get => _parametersBody.ProposedLeaseId ?? null; set => _parametersBody.ProposedLeaseId = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseBlobContainer_LeaseViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersLeaseViaIdentity(InputObject.Id, _parametersBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersLease(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, _parametersBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseContainerResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_Lease.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_Lease.cs new file mode 100644 index 000000000000..44711e4d719d --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_Lease.cs @@ -0,0 +1,456 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 + /// to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseFileShare_Lease", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseFileShare_Lease : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest _parameter; + + /// Lease Share request schema. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Lease Share request schema.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Lease Share request schema.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional. Specify the snapshot time to lease a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Specify the snapshot time to lease a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Specify the snapshot time to lease a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseFileShare_Lease() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesLease(ResourceGroupName, AccountName, ShareName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, Parameter, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,SubscriptionId=SubscriptionId,XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseExpanded.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseExpanded.cs new file mode 100644 index 000000000000..072c958d02cf --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseExpanded.cs @@ -0,0 +1,509 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 + /// to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseFileShare_LeaseExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseFileShare_LeaseExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Lease Share request schema. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseShareRequest(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Specifies the lease action. Can be one of the available actions. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specifies the lease action. Can be one of the available actions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the lease action. Can be one of the available actions.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Action { get => _parametersBody.Action; set => _parametersBody.Action = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.", + SerializedName = @"breakPeriod", + PossibleTypes = new [] { typeof(int) })] + public int BreakPeriod { get => _parametersBody.BreakPeriod ?? default(int); set => _parametersBody.BreakPeriod = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(int) })] + public int LeaseDuration { get => _parametersBody.LeaseDuration ?? default(int); set => _parametersBody.LeaseDuration = value; } + + /// Identifies the lease. Can be specified in any valid GUID string format. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifies the lease. Can be specified in any valid GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the lease. Can be specified in any valid GUID string format.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + public string LeaseId { get => _parametersBody.LeaseId ?? null; set => _parametersBody.LeaseId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional for acquire, required for change. Proposed lease ID, in a GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional for acquire, required for change. Proposed lease ID, in a GUID string format.", + SerializedName = @"proposedLeaseId", + PossibleTypes = new [] { typeof(string) })] + public string ProposedLeaseId { get => _parametersBody.ProposedLeaseId ?? null; set => _parametersBody.ProposedLeaseId = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional. Specify the snapshot time to lease a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Specify the snapshot time to lease a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Specify the snapshot time to lease a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseFileShare_LeaseExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesLease(ResourceGroupName, AccountName, ShareName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,SubscriptionId=SubscriptionId,XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentity.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentity.cs new file mode 100644 index 000000000000..359c6fc8a0d8 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentity.cs @@ -0,0 +1,419 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 + /// to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseFileShare_LeaseViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseFileShare_LeaseViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest _parameter; + + /// Lease Share request schema. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Lease Share request schema.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Lease Share request schema.", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional. Specify the snapshot time to lease a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Specify the snapshot time to lease a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Specify the snapshot time to lease a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseFileShare_LeaseViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesLeaseViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, Parameter, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesLease(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, Parameter, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=Parameter }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded.cs new file mode 100644 index 000000000000..baa7c3815c4a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded.cs @@ -0,0 +1,472 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 + /// to 60 seconds, or can be infinite. + /// + /// + /// [OpenAPI] Lease=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/lease" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageLeaseFileShare_LeaseViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The Lease Share operation establishes and manages a lock on a share for delete operations. The lock duration can be 15 to 60 seconds, or can be infinite.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Lease Share request schema. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareRequest _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LeaseShareRequest(); + + /// Specifies the lease action. Can be one of the available actions. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Specifies the lease action. Can be one of the available actions.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Specifies the lease action. Can be one of the available actions.", + SerializedName = @"action", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LeaseShareAction Action { get => _parametersBody.Action; set => _parametersBody.Action = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// + /// Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and + /// 60. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.", + SerializedName = @"breakPeriod", + PossibleTypes = new [] { typeof(int) })] + public int BreakPeriod { get => _parametersBody.BreakPeriod ?? default(int); set => _parametersBody.BreakPeriod = value; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.", + SerializedName = @"leaseDuration", + PossibleTypes = new [] { typeof(int) })] + public int LeaseDuration { get => _parametersBody.LeaseDuration ?? default(int); set => _parametersBody.LeaseDuration = value; } + + /// Identifies the lease. Can be specified in any valid GUID string format. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Identifies the lease. Can be specified in any valid GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Identifies the lease. Can be specified in any valid GUID string format.", + SerializedName = @"leaseId", + PossibleTypes = new [] { typeof(string) })] + public string LeaseId { get => _parametersBody.LeaseId ?? null; set => _parametersBody.LeaseId = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// Optional for acquire, required for change. Proposed lease ID, in a GUID string format. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional for acquire, required for change. Proposed lease ID, in a GUID string format.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional for acquire, required for change. Proposed lease ID, in a GUID string format.", + SerializedName = @"proposedLeaseId", + PossibleTypes = new [] { typeof(string) })] + public string ProposedLeaseId { get => _parametersBody.ProposedLeaseId ?? null; set => _parametersBody.ProposedLeaseId = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional. Specify the snapshot time to lease a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Specify the snapshot time to lease a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Specify the snapshot time to lease a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageLeaseFileShare_LeaseViaIdentityExpanded() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesLease' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesLeaseViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesLease(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILeaseShareResponse + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_Object.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_Object.cs new file mode 100644 index 000000000000..b07bc6946119 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_Object.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// This operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites + /// require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled + /// and there should be no Legal hold on the container. + /// + /// + /// [OpenAPI] ObjectLevelWorm=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageObjectBlobContainerLevelWorm_Object", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"This operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageObjectBlobContainerLevelWorm_Object : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of InvokeAzStorageObjectBlobContainerLevelWorm_Object + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageObjectBlobContainerLevelWorm_Object Clone() + { + var clone = new InvokeAzStorageObjectBlobContainerLevelWorm_Object(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.ContainerName = this.ContainerName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageObjectBlobContainerLevelWorm_Object() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersObjectLevelWorm' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersObjectLevelWorm(ResourceGroupName, AccountName, ContainerName, SubscriptionId, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ContainerName=ContainerName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ContainerName=ContainerName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity.cs b/swaggerci/storage/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity.cs new file mode 100644 index 000000000000..54f707b083fc --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity.cs @@ -0,0 +1,463 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// This operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites + /// require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled + /// and there should be no Legal hold on the container. + /// + /// + /// [OpenAPI] ObjectLevelWorm=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/migrate" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsLifecycle.Invoke, @"AzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"This operation migrates a blob container from container level WORM to object level immutability enabled container. Prerequisites require a container level immutability policy either in locked or unlocked state, Account level versioning must be enabled and there should be no Legal hold on the container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity Clone() + { + var clone = new InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public InvokeAzStorageObjectBlobContainerLevelWorm_ObjectViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersObjectLevelWorm' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersObjectLevelWormViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersObjectLevelWorm(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_Lock.cs b/swaggerci/storage/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_Lock.cs new file mode 100644 index 000000000000..1473faba72e8 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_Lock.cs @@ -0,0 +1,392 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. + /// ETag in If-Match is required for this operation. + /// + /// + /// [OpenAPI] LockImmutabilityPolicy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Lock, @"AzStorageBlobContainerImmutabilityPolicy_Lock", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class LockAzStorageBlobContainerImmutabilityPolicy_Lock : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public LockAzStorageBlobContainerImmutabilityPolicy_Lock() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersLockImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersLockImmutabilityPolicy(ResourceGroupName, AccountName, ContainerName, SubscriptionId, IfMatch, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,IfMatch=IfMatch}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity.cs b/swaggerci/storage/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity.cs new file mode 100644 index 000000000000..2fe1a06b95f2 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity.cs @@ -0,0 +1,355 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. + /// ETag in If-Match is required for this operation. + /// + /// + /// [OpenAPI] LockImmutabilityPolicy=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/default/lock" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Lock, @"AzStorageBlobContainerImmutabilityPolicy_LockViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Sets the ImmutabilityPolicy to Locked state. The only action allowed on a Locked policy is ExtendImmutabilityPolicy action. ETag in If-Match is required for this operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public LockAzStorageBlobContainerImmutabilityPolicy_LockViaIdentity() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersLockImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersLockImmutabilityPolicyViaIdentity(InputObject.Id, IfMatch, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersLockImmutabilityPolicy(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, IfMatch, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=IfMatch}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_Regenerate.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_Regenerate.cs new file mode 100644 index 000000000000..90fb1805abae --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_Regenerate.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Regenerates one of the access keys or Kerberos keys for the specified storage account. + /// + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageAccountKey_Regenerate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Regenerates one of the access keys or Kerberos keys for the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageAccountKey_Regenerate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters _regenerateKey; + + /// The parameters used to regenerate the storage account key. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters used to regenerate the storage account key.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters used to regenerate the storage account key.", + SerializedName = @"regenerateKey", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters RegenerateKey { get => this._regenerateKey; set => this._regenerateKey = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageAccountKey_Regenerate() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsRegenerateKey(ResourceGroupName, AccountName, SubscriptionId, RegenerateKey, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=RegenerateKey}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / keys / + WriteObject((await response).Key, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateExpanded.cs new file mode 100644 index 000000000000..b46e20a1607d --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateExpanded.cs @@ -0,0 +1,373 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Regenerates one of the access keys or Kerberos keys for the specified storage account. + /// + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageAccountKey_RegenerateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Regenerates one of the access keys or Kerberos keys for the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageAccountKey_RegenerateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The parameters used to regenerate the storage account key. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters _regenerateKeyBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountRegenerateKeyParameters(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => _regenerateKeyBody.KeyName ?? null; set => _regenerateKeyBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageAccountKey_RegenerateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsRegenerateKey(ResourceGroupName, AccountName, SubscriptionId, _regenerateKeyBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_regenerateKeyBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / keys / + WriteObject((await response).Key, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentity.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..e8864920ef57 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentity.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Regenerates one of the access keys or Kerberos keys for the specified storage account. + /// + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageAccountKey_RegenerateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Regenerates one of the access keys or Kerberos keys for the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageAccountKey_RegenerateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters _regenerateKey; + + /// The parameters used to regenerate the storage account key. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters used to regenerate the storage account key.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters used to regenerate the storage account key.", + SerializedName = @"regenerateKey", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters RegenerateKey { get => this._regenerateKey; set => this._regenerateKey = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageAccountKey_RegenerateViaIdentity() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsRegenerateKeyViaIdentity(InputObject.Id, RegenerateKey, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsRegenerateKey(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, RegenerateKey, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=RegenerateKey}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / keys / + WriteObject((await response).Key, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentityExpanded.cs new file mode 100644 index 000000000000..c9153c418b23 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageAccountKey_RegenerateViaIdentityExpanded.cs @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Regenerates one of the access keys or Kerberos keys for the specified storage account. + /// + /// + /// [OpenAPI] RegenerateKey=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/regenerateKey" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageAccountKey_RegenerateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountKey))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Regenerates one of the access keys or Kerberos keys for the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageAccountKey_RegenerateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The parameters used to regenerate the storage account key. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountRegenerateKeyParameters _regenerateKeyBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountRegenerateKeyParameters(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of storage keys that want to be regenerated, possible values are key1, key2, kerb1, kerb2.", + SerializedName = @"keyName", + PossibleTypes = new [] { typeof(string) })] + public string KeyName { get => _regenerateKeyBody.KeyName ?? null; set => _regenerateKeyBody.KeyName = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageAccountKey_RegenerateViaIdentityExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRegenerateKey' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsRegenerateKeyViaIdentity(InputObject.Id, _regenerateKeyBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsRegenerateKey(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, _regenerateKeyBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_regenerateKeyBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountListKeysResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // response should be returning an array of some kind. +Pageable + // nested-array / keys / + WriteObject((await response).Key, true); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageAccount_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageAccount_CreateExpanded.cs new file mode 100644 index 000000000000..674bf226fe19 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageAccount_CreateExpanded.cs @@ -0,0 +1,1074 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent + /// create request is issued with different properties, the account properties will be updated. If an account is already created + /// and a subsequent create or update request is issued with the exact same set of properties, the request will succeed. + /// + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageAccount_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Asynchronously creates a new storage account with the specified parameters. If an account is already created and a subsequent create request is issued with different properties, the account properties will be updated. If an account is already created and a subsequent create or update request is issued with the exact same set of properties, the request will succeed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageAccount_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The parameters used when creating a storage account. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCreateParameters(); + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier AccessTier { get => _parametersBody.AccessTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier)""); set => _parametersBody.AccessTier = value; } + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Specifies the Active Directory account type for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory account type for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType ActiveDirectoryPropertyAccountType { get => _parametersBody.ActiveDirectoryPropertyAccountType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); set => _parametersBody.ActiveDirectoryPropertyAccountType = value; } + + /// Specifies the security identifier (SID) for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the security identifier (SID) for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyAzureStorageSid { get => _parametersBody.ActiveDirectoryPropertyAzureStorageSid ?? null; set => _parametersBody.ActiveDirectoryPropertyAzureStorageSid = value; } + + /// Specifies the domain GUID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the domain GUID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainGuid { get => _parametersBody.ActiveDirectoryPropertyDomainGuid ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainGuid = value; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the primary domain that the AD DNS server is authoritative for.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainName { get => _parametersBody.ActiveDirectoryPropertyDomainName ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainName = value; } + + /// Specifies the security identifier (SID). + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the security identifier (SID).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainSid { get => _parametersBody.ActiveDirectoryPropertyDomainSid ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainSid = value; } + + /// Specifies the Active Directory forest to get. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory forest to get.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyForestName { get => _parametersBody.ActiveDirectoryPropertyForestName ?? null; set => _parametersBody.ActiveDirectoryPropertyForestName = value; } + + /// Specifies the NetBIOS domain name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the NetBIOS domain name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyNetBiosDomainName { get => _parametersBody.ActiveDirectoryPropertyNetBiosDomainName ?? null; set => _parametersBody.ActiveDirectoryPropertyNetBiosDomainName = value; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory SAMAccountName for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertySamAccountName { get => _parametersBody.ActiveDirectoryPropertySamAccountName ?? null; set => _parametersBody.ActiveDirectoryPropertySamAccountName = value; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowBlobPublicAccess { get => _parametersBody.AllowBlobPublicAccess ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowBlobPublicAccess = value; } + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowCrossTenantReplication { get => _parametersBody.AllowCrossTenantReplication ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowCrossTenantReplication = value; } + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowSharedKeyAccess { get => _parametersBody.AllowSharedKeyAccess ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowSharedKeyAccess = value; } + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope AllowedCopyScope { get => _parametersBody.AllowedCopyScope ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope)""); set => _parametersBody.AllowedCopyScope = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Default share permission for users using Kerberos authentication if RBAC role is not assigned.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => _parametersBody.AzureFileIdentityBasedAuthenticationDefaultSharePermission ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); set => _parametersBody.AzureFileIdentityBasedAuthenticationDefaultSharePermission = value; } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the directory service used. Note that this enum may be extended in the future.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => _parametersBody.AzureFileIdentityBasedAuthenticationDirectoryServiceOption ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); set => _parametersBody.AzureFileIdentityBasedAuthenticationDirectoryServiceOption = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string CustomDomainName { get => _parametersBody.CustomDomainName ?? null; set => _parametersBody.CustomDomainName = value; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter CustomDomainUseSubDomainName { get => _parametersBody.CustomDomainUseSubDomainName ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.CustomDomainUseSubDomainName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DefaultToOAuthAuthentication { get => _parametersBody.DefaultToOAuthAuthentication ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.DefaultToOAuthAuthentication = value; } + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType DnsEndpointType { get => _parametersBody.DnsEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); set => _parametersBody.DnsEndpointType = value; } + + /// + /// Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true. The default value is true since API version 2019-04-01.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableHttpsTrafficOnly { get => _parametersBody.EnableHttpsTrafficOnly ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableHttpsTrafficOnly = value; } + + /// NFS 3.0 protocol support enabled if set to true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "NFS 3.0 protocol support enabled if set to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"NFS 3.0 protocol support enabled if set to true.", + SerializedName = @"isNfsV3Enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableNfsV3 { get => _parametersBody.EnableNfsV3 ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableNfsV3 = value; } + + /// + /// Encryption settings to be used for server-side encryption for the storage account. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Encryption settings to be used for server-side encryption for the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Encryption settings to be used for server-side encryption for the storage account.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => _parametersBody.Encryption ?? null /* object */; set => _parametersBody.Encryption = value; } + + /// The name of the extended location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The name of the extended location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The name of the extended location.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string ExtendedLocationName { get => _parametersBody.ExtendedLocationName ?? null; set => _parametersBody.ExtendedLocationName = value; } + + /// The type of the extended location. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The type of the extended location.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The type of the extended location.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes ExtendedLocationType { get => _parametersBody.ExtendedLocationType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ExtendedLocationTypes)""); set => _parametersBody.ExtendedLocationType = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The identity type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The identity type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType IdentityType { get => _parametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType)""); set => _parametersBody.IdentityType = value; } + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => _parametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _parametersBody.IdentityUserAssignedIdentity = value; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmutabilityPolicyAllowProtectedAppendWrite { get => _parametersBody.ImmutabilityPolicyAllowProtectedAppendWrite ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImmutabilityPolicyAllowProtectedAppendWrite = value; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutability period for the blobs in the container since the policy creation, in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + public int ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => _parametersBody.ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ?? default(int); set => _parametersBody.ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value; } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState ImmutabilityPolicyState { get => _parametersBody.ImmutabilityPolicyState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); set => _parametersBody.ImmutabilityPolicyState = value; } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmutableStorageWithVersioningEnabled { get => _parametersBody.ImmutableStorageWithVersioningEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImmutableStorageWithVersioningEnabled = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Account HierarchicalNamespace enabled if sets to true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Account HierarchicalNamespace enabled if sets to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Account HierarchicalNamespace enabled if sets to true.", + SerializedName = @"isHnsEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsHnsEnabled { get => _parametersBody.IsHnsEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IsHnsEnabled = value; } + + /// Enables local users feature, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables local users feature, if set to true")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsLocalUserEnabled { get => _parametersBody.IsLocalUserEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IsLocalUserEnabled = value; } + + /// Enables Secure File Transfer Protocol, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables Secure File Transfer Protocol, if set to true")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsSftpEnabled { get => _parametersBody.IsSftpEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IsSftpEnabled = value; } + + /// The key expiration period in days. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The key expiration period in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + public int KeyPolicyKeyExpirationPeriodInDay { get => _parametersBody.KeyPolicyKeyExpirationPeriodInDay ?? default(int); set => _parametersBody.KeyPolicyKeyExpirationPeriodInDay = value; } + + /// Required. Indicates the type of storage account. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Indicates the type of storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Indicates the type of storage account.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind Kind { get => _parametersBody.Kind; set => _parametersBody.Kind = value; } + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState LargeFileSharesState { get => _parametersBody.LargeFileSharesState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState)""); set => _parametersBody.LargeFileSharesState = value; } + + /// + /// Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions + /// (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but + /// if an identical geo region is specified on update, the request will succeed. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Gets or sets the location of the resource. This will be one of the supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). The geo region of a resource cannot be changed once it is created, but if an identical geo region is specified on update, the request will succeed.", + SerializedName = @"location", + PossibleTypes = new [] { typeof(string) })] + public string Location { get => _parametersBody.Location ?? null; set => _parametersBody.Location = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion MinimumTlsVersion { get => _parametersBody.MinimumTlsVersion ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion)""); set => _parametersBody.MinimumTlsVersion = value; } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, \"Logging, Metrics\"), or None to bypass none of those traffics.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass NetworkRuleSetBypass { get => _parametersBody.NetworkRuleSetBypass ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); set => _parametersBody.NetworkRuleSetBypass = value; } + + /// Specifies the default action of allow or deny when no other rules match. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the default action of allow or deny when no other rules match.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction NetworkRuleSetDefaultAction { get => _parametersBody.NetworkRuleSetDefaultAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); set => _parametersBody.NetworkRuleSetDefaultAction = value; } + + /// Sets the IP ACL rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the IP ACL rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => _parametersBody.NetworkRuleSetIPRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetIPRule = value; } + + /// Sets the resource access rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the resource access rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => _parametersBody.NetworkRuleSetResourceAccessRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetResourceAccessRule = value; } + + /// Sets the virtual network rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the virtual network rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => _parametersBody.NetworkRuleSetVirtualNetworkRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetVirtualNetworkRule = value; } + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess)""); set => _parametersBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether internet routing storage endpoints are to be published")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RoutingPreferencePublishInternetEndpoint { get => _parametersBody.RoutingPreferencePublishInternetEndpoint ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.RoutingPreferencePublishInternetEndpoint = value; } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether microsoft routing storage endpoints are to be published")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RoutingPreferencePublishMicrosoftEndpoint { get => _parametersBody.RoutingPreferencePublishMicrosoftEndpoint ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.RoutingPreferencePublishMicrosoftEndpoint = value; } + + /// Routing Choice defines the kind of network routing opted by the user. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Routing Choice defines the kind of network routing opted by the user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice RoutingPreferenceRoutingChoice { get => _parametersBody.RoutingPreferenceRoutingChoice ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); set => _parametersBody.RoutingPreferenceRoutingChoice = value; } + + /// The SAS expiration period, DD.HH:MM:SS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS expiration period, DD.HH:MM:SS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + public string SasPolicySasExpirationPeriod { get => _parametersBody.SasPolicySasExpirationPeriod ?? null; set => _parametersBody.SasPolicySasExpirationPeriod = value; } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName SkuName { get => _parametersBody.SkuName; set => _parametersBody.SkuName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with + /// a length no greater than 128 characters and a value with a length no greater than 256 characters. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the resource. These tags can be used for viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key with a length no greater than 128 characters and a value with a length no greater than 256 characters.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCreateParametersTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of NewAzStorageAccount_CreateExpanded + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.NewAzStorageAccount_CreateExpanded Clone() + { + var clone = new NewAzStorageAccount_CreateExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageAccount_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsCreate' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsCreate(ResourceGroupName, AccountName, SubscriptionId, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..ad19bec94da4 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation. + /// + /// + /// [OpenAPI] CreateOrUpdateImmutabilityPolicy=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageBlobContainerImmutabilityPolicy_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates or updates an unlocked immutability policy. ETag in If-Match is honored if given but not required for this operation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The ImmutabilityPolicy property of a blob container, including Id, resource name, resource type, Etag. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ImmutabilityPolicy(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing + /// blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWrite { get => _parametersBody.AllowProtectedAppendWrite ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowProtectedAppendWrite = value; } + + /// + /// This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written + /// to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added + /// and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. + /// The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for unlocked time-based retention policies. When enabled, new blocks can be written to both 'Append and Bock Blobs' while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted. This property cannot be changed with ExtendImmutabilityPolicy API. The 'allowProtectedAppendWrites' and 'allowProtectedAppendWritesAll' properties are mutually exclusive.", + SerializedName = @"allowProtectedAppendWritesAll", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowProtectedAppendWritesAll { get => _parametersBody.AllowProtectedAppendWritesAll ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowProtectedAppendWritesAll = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutability period for the blobs in the container since the policy creation, in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + public int ImmutabilityPeriodSinceCreationInDay { get => _parametersBody.ImmutabilityPeriodSinceCreationInDay ?? default(int); set => _parametersBody.ImmutabilityPeriodSinceCreationInDay = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageBlobContainerImmutabilityPolicy_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersCreateOrUpdateImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersCreateOrUpdateImmutabilityPolicy(ResourceGroupName, AccountName, ContainerName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,IfMatch=this.InvocationInformation.BoundParameters.ContainsKey("IfMatch") ? IfMatch : null,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageBlobContainer_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageBlobContainer_CreateExpanded.cs new file mode 100644 index 000000000000..a1e29673c94c --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageBlobContainer_CreateExpanded.cs @@ -0,0 +1,427 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Creates a new container under the specified account as described by request body. The container resource includes metadata + /// and properties for that container. It does not include a list of the blobs contained by the container. + /// + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageBlobContainer_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageBlobContainer_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// Properties of the blob container, including Id, resource name, resource type, Etag. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer _blobContainerBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Properties of the blob container. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Properties of the blob container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Properties of the blob container.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties ContainerProperty { get => _blobContainerBody.ContainerProperty ?? null /* object */; set => _blobContainerBody.ContainerProperty = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageBlobContainer_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersCreate(ResourceGroupName, AccountName, ContainerName, SubscriptionId, _blobContainerBody, onOk, onCreated, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,body=_blobContainerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + WriteObject((await response)); + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageBlobInventoryPolicy_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageBlobInventoryPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..04383d8cfc61 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageBlobInventoryPolicy_CreateExpanded.cs @@ -0,0 +1,436 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Sets the blob inventory policy to the specified storage account. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageBlobInventoryPolicy_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Sets the blob inventory policy to the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageBlobInventoryPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The storage account blob inventory policy. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobInventoryPolicy(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// Policy is enabled if set to true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Policy is enabled if set to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Policy is enabled if set to true.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter PolicyEnabled { get => _propertiesBody.PolicyEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _propertiesBody.PolicyEnabled = value; } + + /// + /// The storage account blob inventory policy rules. The rule is applied when it is enabled. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The storage account blob inventory policy rules. The rule is applied when it is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account blob inventory policy rules. The rule is applied when it is enabled.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicyRule[] PolicyRule { get => _propertiesBody.PolicyRule ?? null /* arrayOf */; set => _propertiesBody.PolicyRule = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageBlobInventoryPolicy_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobInventoryPoliciesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobInventoryPoliciesCreateOrUpdate(ResourceGroupName, AccountName, SubscriptionId, _propertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_propertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, body=_propertiesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, body=_propertiesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobInventoryPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageFileShare_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageFileShare_CreateExpanded.cs new file mode 100644 index 000000000000..fe30f26a80cb --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageFileShare_CreateExpanded.cs @@ -0,0 +1,564 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Creates a new share under the specified account as described by request body. The share resource includes metadata and + /// properties for that share. It does not include a list of the files contained by the share. + /// + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageFileShare_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageFileShare_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Properties of the file share, including Id, resource name, resource type, Etag. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare _fileShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private string _expand; + + /// + /// Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a + /// string with delimiter ',' + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string with delimiter ','")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string with delimiter ','", + SerializedName = @"$expand", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Expand { get => this._expand; set => this._expand = value; } + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier FileSharePropertyAccessTier { get => _fileShareBody.PropertyAccessTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier)""); set => _fileShareBody.PropertyAccessTier = value; } + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authentication protocol that is used for the file share. Can only be specified when creating a share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication protocol that is used for the file share. Can only be specified when creating a share.", + SerializedName = @"enabledProtocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols FileSharePropertyEnabledProtocol { get => _fileShareBody.PropertyEnabledProtocol ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols)""); set => _fileShareBody.PropertyEnabledProtocol = value; } + + /// A name-value pair to associate with the share as metadata. + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A name-value pair to associate with the share as metadata.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the share as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata FileSharePropertyMetadata { get => _fileShareBody.PropertyMetadata ?? null /* object */; set => _fileShareBody.PropertyMetadata = value; } + + /// The property is for NFS share only. The default is NoRootSquash. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The property is for NFS share only. The default is NoRootSquash.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The property is for NFS share only. The default is NoRootSquash.", + SerializedName = @"rootSquash", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType FileSharePropertyRootSquash { get => _fileShareBody.PropertyRootSquash ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType)""); set => _fileShareBody.PropertyRootSquash = value; } + + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.", + SerializedName = @"shareQuota", + PossibleTypes = new [] { typeof(int) })] + public int FileSharePropertyShareQuota { get => _fileShareBody.PropertyShareQuota ?? default(int); set => _fileShareBody.PropertyShareQuota = value; } + + /// List of stored access policies specified on the share. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of stored access policies specified on the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the share.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] FileSharePropertySignedIdentifier { get => _fileShareBody.PropertySignedIdentifier ?? null /* arrayOf */; set => _fileShareBody.PropertySignedIdentifier = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnCreated will be called before the regular onCreated has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// /// Determines if the rest of the onCreated method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageFileShare_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesCreate(ResourceGroupName, AccountName, ShareName, this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId, _fileShareBody, onOk, onCreated, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null,SubscriptionId=SubscriptionId,body=_fileShareBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 201 (Created). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onCreated(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnCreated(responseMessage, response, ref _returnNow); + // if overrideOnCreated has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onCreated - response for 201 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + WriteObject((await response)); + } + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId=SubscriptionId, body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, Expand=this.InvocationInformation.BoundParameters.ContainsKey("Expand") ? Expand : null, SubscriptionId=SubscriptionId, body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUserPassword_Regenerate.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUserPassword_Regenerate.cs new file mode 100644 index 000000000000..337fa0aa90df --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUserPassword_Regenerate.cs @@ -0,0 +1,425 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Regenerate the local user SSH password. + /// + /// [OpenAPI] RegeneratePassword=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageLocalUserPassword_Regenerate", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Regenerate the local user SSH password.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageLocalUserPassword_Regenerate : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _username; + + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Username { get => this._username; set => this._username = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageLocalUserPassword_Regenerate() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LocalUsersRegeneratePassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LocalUsersRegeneratePassword(ResourceGroupName, AccountName, SubscriptionId, Username, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Username=Username}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult + WriteObject((await response).SshPassword); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUserPassword_RegenerateViaIdentity.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUserPassword_RegenerateViaIdentity.cs new file mode 100644 index 000000000000..73f9c0fc3ebe --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUserPassword_RegenerateViaIdentity.cs @@ -0,0 +1,389 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Regenerate the local user SSH password. + /// + /// [OpenAPI] RegeneratePassword=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}/regeneratePassword" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageLocalUserPassword_RegenerateViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(string))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Regenerate the local user SSH password.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageLocalUserPassword_RegenerateViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageLocalUserPassword_RegenerateViaIdentity() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LocalUsersRegeneratePassword' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.LocalUsersRegeneratePasswordViaIdentity(InputObject.Id, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Username) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Username"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.LocalUsersRegeneratePassword(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.Username ?? null, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUserRegeneratePasswordResult + WriteObject((await response).SshPassword); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUser_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUser_CreateExpanded.cs new file mode 100644 index 000000000000..743008d0318f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageLocalUser_CreateExpanded.cs @@ -0,0 +1,502 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Create or update the properties of a local user associated with the storage account + /// + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageLocalUser_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Create or update the properties of a local user associated with the storage account")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageLocalUser_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The local user associated with the storage accounts. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.LocalUser(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Indicates whether shared key exists. Set it to false to remove existing shared key. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether shared key exists. Set it to false to remove existing shared key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether shared key exists. Set it to false to remove existing shared key.", + SerializedName = @"hasSharedKey", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter HasSharedKey { get => _propertiesBody.HasSharedKey ?? default(global::System.Management.Automation.SwitchParameter); set => _propertiesBody.HasSharedKey = value; } + + /// Indicates whether ssh key exists. Set it to false to remove existing SSH key. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether ssh key exists. Set it to false to remove existing SSH key.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ssh key exists. Set it to false to remove existing SSH key.", + SerializedName = @"hasSshKey", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter HasSshKey { get => _propertiesBody.HasSshKey ?? default(global::System.Management.Automation.SwitchParameter); set => _propertiesBody.HasSshKey = value; } + + /// + /// Indicates whether ssh password exists. Set it to false to remove existing SSH password. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether ssh password exists. Set it to false to remove existing SSH password.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether ssh password exists. Set it to false to remove existing SSH password.", + SerializedName = @"hasSshPassword", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter HasSshPassword { get => _propertiesBody.HasSshPassword ?? default(global::System.Management.Automation.SwitchParameter); set => _propertiesBody.HasSshPassword = value; } + + /// Optional, local user home directory. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, local user home directory.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, local user home directory.", + SerializedName = @"homeDirectory", + PossibleTypes = new [] { typeof(string) })] + public string HomeDirectory { get => _propertiesBody.HomeDirectory ?? null; set => _propertiesBody.HomeDirectory = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The permission scopes of the local user. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The permission scopes of the local user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The permission scopes of the local user.", + SerializedName = @"permissionScopes", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IPermissionScope[] PermissionScope { get => _propertiesBody.PermissionScope ?? null /* arrayOf */; set => _propertiesBody.PermissionScope = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Optional, local user ssh authorized keys for SFTP. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, local user ssh authorized keys for SFTP.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, local user ssh authorized keys for SFTP.", + SerializedName = @"sshAuthorizedKeys", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISshPublicKey[] SshAuthorizedKey { get => _propertiesBody.SshAuthorizedKey ?? null /* arrayOf */; set => _propertiesBody.SshAuthorizedKey = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _username; + + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Username { get => this._username; set => this._username = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageLocalUser_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LocalUsersCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LocalUsersCreateOrUpdate(ResourceGroupName, AccountName, SubscriptionId, Username, _propertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Username=Username,body=_propertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username, body=_propertiesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username, body=_propertiesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ILocalUser + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageManagementPolicy_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageManagementPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..ca83b715697a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageManagementPolicy_CreateExpanded.cs @@ -0,0 +1,371 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Sets the managementpolicy to the specified storage account. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageManagementPolicy_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Sets the managementpolicy to the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageManagementPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The Get Storage Account ManagementPolicies operation response. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ManagementPolicy(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// + /// The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + /// + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicyRule[] PolicyRule { get => _propertiesBody.PolicyRule ?? null /* arrayOf */; set => _propertiesBody.PolicyRule = value; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageManagementPolicy_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagementPoliciesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagementPoliciesCreateOrUpdate(ResourceGroupName, AccountName, SubscriptionId, _propertiesBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_propertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IManagementPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageObjectReplicationPolicy_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageObjectReplicationPolicy_CreateExpanded.cs new file mode 100644 index 000000000000..5c9961e919b7 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageObjectReplicationPolicy_CreateExpanded.cs @@ -0,0 +1,470 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Create or update the object replication policy of the storage account. + /// + /// [OpenAPI] CreateOrUpdate=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageObjectReplicationPolicy_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Create or update the object replication policy of the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageObjectReplicationPolicy_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The replication policy between two storage accounts. Multiple rules can be defined in one policy. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy _propertiesBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ObjectReplicationPolicy(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required. Destination account name. It should be full resource id if allowCrossTenantReplication set to false.", + SerializedName = @"destinationAccount", + PossibleTypes = new [] { typeof(string) })] + public string DestinationAccount { get => _propertiesBody.DestinationAccount ?? null; set => _propertiesBody.DestinationAccount = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// + /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the + /// source account, provide the value of the policy ID that is returned when you download the policy that was defined on the + /// destination account. The policy is downloaded as a JSON file. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file.", + SerializedName = @"objectReplicationPolicyId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ObjectReplicationPolicyId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// The storage account object replication rules. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The storage account object replication rules.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The storage account object replication rules.", + SerializedName = @"rules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicyRule[] Rule { get => _propertiesBody.Rule ?? null /* arrayOf */; set => _propertiesBody.Rule = value; } + + /// + /// Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required. Source account name. It should be full resource id if allowCrossTenantReplication set to false.", + SerializedName = @"sourceAccount", + PossibleTypes = new [] { typeof(string) })] + public string SourceAccount { get => _propertiesBody.SourceAccount ?? null; set => _propertiesBody.SourceAccount = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageObjectReplicationPolicy_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ObjectReplicationPoliciesCreateOrUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ObjectReplicationPoliciesCreateOrUpdate(ResourceGroupName, AccountName, SubscriptionId, Id, _propertiesBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Id=Id,body=_propertiesBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Id=Id, body=_propertiesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Id=Id, body=_propertiesBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IObjectReplicationPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageQueue_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageQueue_CreateExpanded.cs new file mode 100644 index 000000000000..819702c29134 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageQueue_CreateExpanded.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Creates a new queue with the specified queue name, under the specified account. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageQueue_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new queue with the specified queue name, under the specified account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageQueue_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue _queueBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot + /// have two consecutive dash(-) characters. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.", + SerializedName = @"queueName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("QueueName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// A name-value pair that represents queue metadata. + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A name-value pair that represents queue metadata.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair that represents queue metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata QueuePropertyMetadata { get => _queueBody.QueuePropertyMetadata ?? null /* object */; set => _queueBody.QueuePropertyMetadata = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageQueue_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueueCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueCreate(ResourceGroupName, AccountName, SubscriptionId, Name, _queueBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name,body=_queueBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_queueBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_queueBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/NewAzStorageTable_CreateExpanded.cs b/swaggerci/storage/generated/cmdlets/NewAzStorageTable_CreateExpanded.cs new file mode 100644 index 000000000000..c71534d942c6 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/NewAzStorageTable_CreateExpanded.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Creates a new table with the specified table name, under the specified account. + /// + /// [OpenAPI] Create=>PUT:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.New, @"AzStorageTable_CreateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new table with the specified table name, under the specified account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class NewAzStorageTable_CreateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Properties of the table, including Id, resource name, resource type. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// only alphanumeric characters and it cannot begin with a numeric character. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TableName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// List of stored access policies specified on the table. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of stored access policies specified on the table.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the table.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] TablePropertySignedIdentifier { get => _parametersBody.PropertySignedIdentifier ?? null /* arrayOf */; set => _parametersBody.PropertySignedIdentifier = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public NewAzStorageTable_CreateExpanded() + { + + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TableCreate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableCreate(ResourceGroupName, AccountName, SubscriptionId, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageAccount_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageAccount_Delete.cs new file mode 100644 index 000000000000..7b8ba67606a0 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageAccount_Delete.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes a storage account in Microsoft Azure. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageAccount_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes a storage account in Microsoft Azure.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageAccount_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsDelete(ResourceGroupName, AccountName, SubscriptionId, onOk, onNoContent, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageAccount_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageAccount_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageAccount_DeleteViaIdentity.cs new file mode 100644 index 000000000000..eee26c763c7b --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageAccount_DeleteViaIdentity.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes a storage account in Microsoft Azure. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageAccount_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes a storage account in Microsoft Azure.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageAccount_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onNoContent, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageAccount_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_Delete.cs new file mode 100644 index 000000000000..88d7e862a1ae --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_Delete.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag + /// in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete + /// the container after deleting all expired blobs inside the policy locked container. + /// + /// + /// [OpenAPI] DeleteImmutabilityPolicy=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageBlobContainerImmutabilityPolicy_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageBlobContainerImmutabilityPolicy_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersDeleteImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersDeleteImmutabilityPolicy(ResourceGroupName, AccountName, ContainerName, SubscriptionId, IfMatch, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,IfMatch=IfMatch}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageBlobContainerImmutabilityPolicy_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..63cd03298a2a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag + /// in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete + /// the container after deleting all expired blobs inside the policy locked container. + /// + /// + /// [OpenAPI] DeleteImmutabilityPolicy=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}/immutabilityPolicies/{immutabilityPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Aborts an unlocked immutability policy. The response of delete has immutabilityPeriodSinceCreationInDays set to 0. ETag in If-Match is required for this operation. Deleting a locked immutability policy is not allowed, the only way is to delete the container after deleting all expired blobs inside the policy locked container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _ifMatch; + + /// + /// The entity state (ETag) version of the immutability policy to update. A value of "*" can be used to apply the operation + /// only if the immutability policy already exists. If omitted, this operation will always be applied. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The entity state (ETag) version of the immutability policy to update. A value of \"*\" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The entity state (ETag) version of the immutability policy to update. A value of ""*"" can be used to apply the operation only if the immutability policy already exists. If omitted, this operation will always be applied.", + SerializedName = @"If-Match", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string IfMatch { get => this._ifMatch; set => this._ifMatch = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersDeleteImmutabilityPolicy' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersDeleteImmutabilityPolicyViaIdentity(InputObject.Id, IfMatch, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersDeleteImmutabilityPolicy(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, IfMatch, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { IfMatch=IfMatch}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet + /// class. + /// + public RemoveAzStorageBlobContainerImmutabilityPolicy_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IImmutabilityPolicy + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainer_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainer_Delete.cs new file mode 100644 index 000000000000..ed229aa471e5 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainer_Delete.cs @@ -0,0 +1,411 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes specified container under its account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageBlobContainer_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes specified container under its account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageBlobContainer_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersDelete(ResourceGroupName, AccountName, ContainerName, SubscriptionId, onOk, onNoContent, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageBlobContainer_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainer_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainer_DeleteViaIdentity.cs new file mode 100644 index 000000000000..7dad7b1a4e3d --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobContainer_DeleteViaIdentity.cs @@ -0,0 +1,374 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes specified container under its account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageBlobContainer_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes specified container under its account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageBlobContainer_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersDeleteViaIdentity(InputObject.Id, onOk, onNoContent, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, onOk, onNoContent, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageBlobContainer_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_Delete.cs new file mode 100644 index 000000000000..bda8dda011dc --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_Delete.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the blob inventory policy associated with the specified storage account. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageBlobInventoryPolicy_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the blob inventory policy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageBlobInventoryPolicy_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobInventoryPoliciesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobInventoryPoliciesDelete(ResourceGroupName, AccountName, SubscriptionId, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageBlobInventoryPolicy_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..35185cb30fa4 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity.cs @@ -0,0 +1,426 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the blob inventory policy associated with the specified storage account. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/inventoryPolicies/{blobInventoryPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageBlobInventoryPolicy_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the blob inventory policy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobInventoryPoliciesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobInventoryPoliciesDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobInventoryPoliciesDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageBlobInventoryPolicy_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageFileShare_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageFileShare_Delete.cs new file mode 100644 index 000000000000..478b6931fbd3 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageFileShare_Delete.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes specified share under its account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageFileShare_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes specified share under its account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageFileShare_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _include; + + /// + /// Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file + /// share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, the deletion + /// fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). For + /// 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or unleased), + /// the deletion fails. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or unleased), the deletion fails.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or unleased), the deletion fails.", + SerializedName = @"$include", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Include { get => this._include; set => this._include = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional, used to delete a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to delete a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to delete a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesDelete(ResourceGroupName, AccountName, ShareName, SubscriptionId, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,SubscriptionId=SubscriptionId,XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null,Include=this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageFileShare_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, Include=this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, Include=this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageFileShare_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageFileShare_DeleteViaIdentity.cs new file mode 100644 index 000000000000..5d792fc6f99b --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageFileShare_DeleteViaIdentity.cs @@ -0,0 +1,462 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes specified share under its account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageFileShare_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes specified share under its account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageFileShare_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _include; + + /// + /// Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file + /// share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, the deletion + /// fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). For + /// 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or unleased), + /// the deletion fails. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or unleased), the deletion fails.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Valid values are: snapshots, leased-snapshots, none. The default value is snapshots. For 'snapshots', the file share is deleted including all of its file share snapshots. If the file share contains leased-snapshots, the deletion fails. For 'leased-snapshots', the file share is deleted included all of its file share snapshots (leased/unleased). For 'none', the file share is deleted if it has no share snapshots. If the file share contains any snapshots (leased or unleased), the deletion fails.", + SerializedName = @"$include", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Query)] + public string Include { get => this._include; set => this._include = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _xmsSnapshot; + + /// Optional, used to delete a snapshot. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional, used to delete a snapshot.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional, used to delete a snapshot.", + SerializedName = @"x-ms-snapshot", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Header)] + public string XmsSnapshot { get => this._xmsSnapshot; set => this._xmsSnapshot = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesDeleteViaIdentity(InputObject.Id, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null,Include=this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageFileShare_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, Include=this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { XmsSnapshot=this.InvocationInformation.BoundParameters.ContainsKey("XmsSnapshot") ? XmsSnapshot : null, Include=this.InvocationInformation.BoundParameters.ContainsKey("Include") ? Include : null }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageLocalUser_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageLocalUser_Delete.cs new file mode 100644 index 000000000000..6a7520cd1f9f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageLocalUser_Delete.cs @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes the local user associated with the specified storage account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageLocalUser_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the local user associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageLocalUser_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Backing field for property. + private string _username; + + /// + /// The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the + /// storage account. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of local user. The username must contain lowercase letters and numbers only. It must be unique only within the storage account.", + SerializedName = @"username", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Username { get => this._username; set => this._username = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LocalUsersDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.LocalUsersDelete(ResourceGroupName, AccountName, SubscriptionId, Username, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Username=Username}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageLocalUser_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Username=Username }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageLocalUser_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageLocalUser_DeleteViaIdentity.cs new file mode 100644 index 000000000000..fc0f54d1f351 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageLocalUser_DeleteViaIdentity.cs @@ -0,0 +1,428 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes the local user associated with the specified storage account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/localUsers/{username}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageLocalUser_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the local user associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageLocalUser_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'LocalUsersDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.LocalUsersDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.Username) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.Username"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.LocalUsersDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.Username ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageLocalUser_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageManagementPolicy_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageManagementPolicy_Delete.cs new file mode 100644 index 000000000000..130303a038be --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageManagementPolicy_Delete.cs @@ -0,0 +1,393 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes the managementpolicy associated with the specified storage account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageManagementPolicy_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the managementpolicy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageManagementPolicy_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagementPoliciesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ManagementPoliciesDelete(ResourceGroupName, AccountName, SubscriptionId, onOk, onNoContent, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageManagementPolicy_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageManagementPolicy_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageManagementPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..651b425c4f48 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageManagementPolicy_DeleteViaIdentity.cs @@ -0,0 +1,370 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Deletes the managementpolicy associated with the specified storage account. + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/managementPolicies/{managementPolicyName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageManagementPolicy_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the managementpolicy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageManagementPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ManagementPoliciesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ManagementPoliciesDeleteViaIdentity(InputObject.Id, onOk, onNoContent, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ManagementPoliciesDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, onNoContent, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageManagementPolicy_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_Delete.cs new file mode 100644 index 000000000000..aa0c51e4cfea --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_Delete.cs @@ -0,0 +1,468 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the object replication policy associated with the specified storage account. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageObjectReplicationPolicy_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the object replication policy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageObjectReplicationPolicy_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private string _id; + + /// + /// For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the + /// source account, provide the value of the policy ID that is returned when you download the policy that was defined on the + /// destination account. The policy is downloaded as a JSON file. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"For the destination account, provide the value 'default'. Configure the policy on the destination account first. For the source account, provide the value of the policy ID that is returned when you download the policy that was defined on the destination account. The policy is downloaded as a JSON file.", + SerializedName = @"objectReplicationPolicyId", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("ObjectReplicationPolicyId")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Id { get => this._id; set => this._id = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ObjectReplicationPoliciesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.ObjectReplicationPoliciesDelete(ResourceGroupName, AccountName, SubscriptionId, Id, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Id=Id}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageObjectReplicationPolicy_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Id=Id }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Id=Id }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity.cs new file mode 100644 index 000000000000..2a1c88f00a8d --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the object replication policy associated with the specified storage account. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/objectReplicationPolicies/{objectReplicationPolicyId}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageObjectReplicationPolicy_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the object replication policy associated with the specified storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'ObjectReplicationPoliciesDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.ObjectReplicationPoliciesDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ObjectReplicationPolicyId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ObjectReplicationPolicyId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.ObjectReplicationPoliciesDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.ObjectReplicationPolicyId ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageObjectReplicationPolicy_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_Delete.cs new file mode 100644 index 000000000000..55bb397b9ff6 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_Delete.cs @@ -0,0 +1,464 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the specified private endpoint connection associated with the storage account. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStoragePrivateEndpointConnection_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the specified private endpoint connection associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStoragePrivateEndpointConnection_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// The name of the private endpoint connection associated with the Azure resource + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the private endpoint connection associated with the Azure resource")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the private endpoint connection associated with the Azure resource", + SerializedName = @"privateEndpointConnectionName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("PrivateEndpointConnectionName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.PrivateEndpointConnectionsDelete(ResourceGroupName, AccountName, SubscriptionId, Name, onOk, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStoragePrivateEndpointConnection_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity.cs new file mode 100644 index 000000000000..4f7db1da38e3 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity.cs @@ -0,0 +1,430 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the specified private endpoint connection associated with the storage account. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStoragePrivateEndpointConnection_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the specified private endpoint connection associated with the storage account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'PrivateEndpointConnectionsDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.PrivateEndpointConnectionsDeleteViaIdentity(InputObject.Id, onOk, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.PrivateEndpointConnectionName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.PrivateEndpointConnectionName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.PrivateEndpointConnectionsDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.PrivateEndpointConnectionName ?? null, onOk, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStoragePrivateEndpointConnection_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageQueue_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageQueue_Delete.cs new file mode 100644 index 000000000000..0cfccd4bfb95 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageQueue_Delete.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the queue with the specified queue name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageQueue_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the queue with the specified queue name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageQueue_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot + /// have two consecutive dash(-) characters. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.", + SerializedName = @"queueName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("QueueName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueueDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueDelete(ResourceGroupName, AccountName, SubscriptionId, Name, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageQueue_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageQueue_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageQueue_DeleteViaIdentity.cs new file mode 100644 index 000000000000..4fe70b6f2e33 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageQueue_DeleteViaIdentity.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the queue with the specified queue name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageQueue_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the queue with the specified queue name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageQueue_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueueDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueueDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.QueueName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.QueueName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueueDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.QueueName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageQueue_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageTable_Delete.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageTable_Delete.cs new file mode 100644 index 000000000000..ffe4a7e61c5f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageTable_Delete.cs @@ -0,0 +1,433 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the table with the specified table name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageTable_Delete", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the table with the specified table name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageTable_Delete : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// only alphanumeric characters and it cannot begin with a numeric character. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TableName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TableDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableDelete(ResourceGroupName, AccountName, SubscriptionId, Name, onNoContent, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageTable_Delete() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RemoveAzStorageTable_DeleteViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RemoveAzStorageTable_DeleteViaIdentity.cs new file mode 100644 index 000000000000..c2123c56669f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RemoveAzStorageTable_DeleteViaIdentity.cs @@ -0,0 +1,396 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Deletes the table with the specified table name, under the specified account if it exists. + /// + /// + /// [OpenAPI] Delete=>DELETE:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsCommon.Remove, @"AzStorageTable_DeleteViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Deletes the table with the specified table name, under the specified account if it exists.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RemoveAzStorageTable_DeleteViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnNoContent will be called before the regular onNoContent has been processed, allowing customization of + /// what happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onNoContent method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnNoContent(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TableDelete' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TableDeleteViaIdentity(InputObject.Id, onNoContent, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TableName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TableName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TableDelete(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.TableName ?? null, onNoContent, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RemoveAzStorageTable_DeleteViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 204 (NoContent). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onNoContent(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnNoContent(responseMessage, ref _returnNow); + // if overrideOnNoContent has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onNoContent - response for 204 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_Restore.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_Restore.cs new file mode 100644 index 000000000000..d97c10513f6e --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_Restore.cs @@ -0,0 +1,434 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Restore blobs in the specified blob ranges + /// + /// [OpenAPI] RestoreBlobRanges=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageAccountBlobRange_Restore", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageAccountBlobRange_Restore : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters _parameter; + + /// Blob restore parameters + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Blob restore parameters", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob restore parameters", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RestoreAzStorageAccountBlobRange_Restore + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.RestoreAzStorageAccountBlobRange_Restore Clone() + { + var clone = new RestoreAzStorageAccountBlobRange_Restore(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.SubscriptionId = this.SubscriptionId; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRestoreBlobRanges' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsRestoreBlobRanges(ResourceGroupName, AccountName, SubscriptionId, Parameter, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageAccountBlobRange_Restore() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreExpanded.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreExpanded.cs new file mode 100644 index 000000000000..aaa62e0b02a5 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreExpanded.cs @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Restore blobs in the specified blob ranges + /// + /// [OpenAPI] RestoreBlobRanges=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageAccountBlobRange_RestoreExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageAccountBlobRange_RestoreExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Blob restore parameters + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParameters(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Blob ranges to restore. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Blob ranges to restore.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob ranges to restore.", + SerializedName = @"blobRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] BlobRange { get => _parametersBody.BlobRange ?? null /* arrayOf */; set => _parametersBody.BlobRange = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// Restore blob to the specified time. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Restore blob to the specified time.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Restore blob to the specified time.", + SerializedName = @"timeToRestore", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimeToRestore { get => _parametersBody.TimeToRestore; set => _parametersBody.TimeToRestore = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RestoreAzStorageAccountBlobRange_RestoreExpanded + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.RestoreAzStorageAccountBlobRange_RestoreExpanded Clone() + { + var clone = new RestoreAzStorageAccountBlobRange_RestoreExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + clone.ResourceGroupName = this.ResourceGroupName; + clone.AccountName = this.AccountName; + clone.SubscriptionId = this.SubscriptionId; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRestoreBlobRanges' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsRestoreBlobRanges(ResourceGroupName, AccountName, SubscriptionId, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageAccountBlobRange_RestoreExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentity.cs new file mode 100644 index 000000000000..cb4d74ba9c3b --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentity.cs @@ -0,0 +1,408 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Restore blobs in the specified blob ranges + /// + /// [OpenAPI] RestoreBlobRanges=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageAccountBlobRange_RestoreViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageAccountBlobRange_RestoreViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters _parameter; + + /// Blob restore parameters + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Blob restore parameters", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob restore parameters", + SerializedName = @"parameters", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters Parameter { get => this._parameter; set => this._parameter = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// a duplicate instance of RestoreAzStorageAccountBlobRange_RestoreViaIdentity + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.RestoreAzStorageAccountBlobRange_RestoreViaIdentity Clone() + { + var clone = new RestoreAzStorageAccountBlobRange_RestoreViaIdentity(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone.Parameter = this.Parameter; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRestoreBlobRanges' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsRestoreBlobRangesViaIdentity(InputObject.Id, Parameter, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsRestoreBlobRanges(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, Parameter, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=Parameter}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageAccountBlobRange_RestoreViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded.cs new file mode 100644 index 000000000000..ae1c460b6e14 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded.cs @@ -0,0 +1,423 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Restore blobs in the specified blob ranges + /// + /// [OpenAPI] RestoreBlobRanges=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/restoreBlobRanges" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageAccountBlobRange_RestoreViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore blobs in the specified blob ranges")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Blob restore parameters + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobRestoreParameters(); + + /// when specified, runs this cmdlet as a PowerShell job + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command as a job")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter AsJob { get; set; } + + /// Blob ranges to restore. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Blob ranges to restore.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Blob ranges to restore.", + SerializedName = @"blobRanges", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreRange[] BlobRange { get => _parametersBody.BlobRange ?? null /* arrayOf */; set => _parametersBody.BlobRange = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// when specified, will make the remote call, and return an AsyncOperationResponse, letting the remote operation continue + /// asynchronously. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Run the command asynchronously")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter NoWait { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Restore blob to the specified time. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Restore blob to the specified time.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Restore blob to the specified time.", + SerializedName = @"timeToRestore", + PossibleTypes = new [] { typeof(global::System.DateTime) })] + public global::System.DateTime TimeToRestore { get => _parametersBody.TimeToRestore; set => _parametersBody.TimeToRestore = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Creates a duplicate instance of this cmdlet (via JSON serialization). + /// + /// a duplicate instance of RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded + /// + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets.RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded Clone() + { + var clone = new RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded(); + clone.__correlationId = this.__correlationId; + clone.__processRecordId = this.__processRecordId; + clone.DefaultProfile = this.DefaultProfile; + clone.InvocationInformation = this.InvocationInformation; + clone.Proxy = this.Proxy; + clone.Pipeline = this.Pipeline; + clone.AsJob = this.AsJob; + clone.Break = this.Break; + clone.ProxyCredential = this.ProxyCredential; + clone.ProxyUseDefaultCredentials = this.ProxyUseDefaultCredentials; + clone.HttpPipelinePrepend = this.HttpPipelinePrepend; + clone.HttpPipelineAppend = this.HttpPipelineAppend; + clone._parametersBody = this._parametersBody; + return clone; + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + // When an operation supports asjob, Information messages must go thru verbose. + WriteVerbose($"INFORMATION: {(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.DelayBeforePolling: + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("NoWait")) + { + var data = messageData(); + if (data.ResponseMessage is System.Net.Http.HttpResponseMessage response) + { + var asyncOperation = response.GetFirstHeader(@"Azure-AsyncOperation"); + var location = response.GetFirstHeader(@"Location"); + var uri = global::System.String.IsNullOrEmpty(asyncOperation) ? global::System.String.IsNullOrEmpty(location) ? response.RequestMessage.RequestUri.AbsoluteUri : location : asyncOperation; + WriteObject(new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncOperationResponse { Target = uri }); + // do nothing more. + data.Cancel(); + return; + } + } + break; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRestoreBlobRanges' operation")) + { + if (true == MyInvocation?.BoundParameters?.ContainsKey("AsJob")) + { + var instance = this.Clone(); + var job = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncJob(instance, this.MyInvocation.Line, this.MyInvocation.MyCommand.Name, this._cancellationTokenSource.Token, this._cancellationTokenSource.Cancel); + JobRepository.Add(job); + var task = instance.ProcessRecordAsync(); + job.Monitor(task); + WriteObject(job); + } + else + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsRestoreBlobRangesViaIdentity(InputObject.Id, _parametersBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsRestoreBlobRanges(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, _parametersBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageAccountBlobRange_RestoreViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobRestoreStatus + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_Restore.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_Restore.cs new file mode 100644 index 000000000000..da3430eb6c46 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_Restore.cs @@ -0,0 +1,446 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Restore a file share within a valid retention days if share soft delete is enabled + /// + /// + /// [OpenAPI] Restore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageFileShare_Restore", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore a file share within a valid retention days if share soft delete is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageFileShare_Restore : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare _deletedShare; + + /// The deleted share to be restored. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The deleted share to be restored.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The deleted share to be restored.", + SerializedName = @"deletedShare", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare DeletedShare { get => this._deletedShare; set => this._deletedShare = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesRestore' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesRestore(ResourceGroupName, AccountName, ShareName, SubscriptionId, DeletedShare, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,SubscriptionId=SubscriptionId,body=DeletedShare}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageFileShare_Restore() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, body=DeletedShare }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, body=DeletedShare }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreExpanded.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreExpanded.cs new file mode 100644 index 000000000000..babac13188f9 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreExpanded.cs @@ -0,0 +1,458 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Restore a file share within a valid retention days if share soft delete is enabled + /// + /// + /// [OpenAPI] Restore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageFileShare_RestoreExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore a file share within a valid retention days if share soft delete is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageFileShare_RestoreExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The deleted share to be restored. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare _deletedShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedShare(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Required. Identify the name of the deleted share that will be restored. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Identify the name of the deleted share that will be restored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Identify the name of the deleted share that will be restored.", + SerializedName = @"deletedShareName", + PossibleTypes = new [] { typeof(string) })] + public string DeletedShareName { get => _deletedShareBody.Name ?? null; set => _deletedShareBody.Name = value; } + + /// Required. Identify the version of the deleted share that will be restored. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Identify the version of the deleted share that will be restored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Identify the version of the deleted share that will be restored.", + SerializedName = @"deletedShareVersion", + PossibleTypes = new [] { typeof(string) })] + public string DeletedShareVersion { get => _deletedShareBody.Version ?? null; set => _deletedShareBody.Version = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesRestore' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesRestore(ResourceGroupName, AccountName, ShareName, SubscriptionId, _deletedShareBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,SubscriptionId=SubscriptionId,body=_deletedShareBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageFileShare_RestoreExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, body=_deletedShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, body=_deletedShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentity.cs new file mode 100644 index 000000000000..fd65d2cab07f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentity.cs @@ -0,0 +1,409 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Restore a file share within a valid retention days if share soft delete is enabled + /// + /// + /// [OpenAPI] Restore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageFileShare_RestoreViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore a file share within a valid retention days if share soft delete is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageFileShare_RestoreViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare _deletedShare; + + /// The deleted share to be restored. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The deleted share to be restored.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The deleted share to be restored.", + SerializedName = @"deletedShare", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare DeletedShare { get => this._deletedShare; set => this._deletedShare = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesRestore' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesRestoreViaIdentity(InputObject.Id, DeletedShare, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesRestore(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, DeletedShare, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DeletedShare}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageFileShare_RestoreViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DeletedShare }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=DeletedShare }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentityExpanded.cs new file mode 100644 index 000000000000..ae22294a1bb7 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RestoreAzStorageFileShare_RestoreViaIdentityExpanded.cs @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Restore a file share within a valid retention days if share soft delete is enabled + /// + /// + /// [OpenAPI] Restore=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}/restore" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Restore, @"AzStorageFileShare_RestoreViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Restore a file share within a valid retention days if share soft delete is enabled")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RestoreAzStorageFileShare_RestoreViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The deleted share to be restored. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IDeletedShare _deletedShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.DeletedShare(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Required. Identify the name of the deleted share that will be restored. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Identify the name of the deleted share that will be restored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Identify the name of the deleted share that will be restored.", + SerializedName = @"deletedShareName", + PossibleTypes = new [] { typeof(string) })] + public string DeletedShareName { get => _deletedShareBody.Name ?? null; set => _deletedShareBody.Name = value; } + + /// Required. Identify the version of the deleted share that will be restored. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Required. Identify the version of the deleted share that will be restored.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"Required. Identify the version of the deleted share that will be restored.", + SerializedName = @"deletedShareVersion", + PossibleTypes = new [] { typeof(string) })] + public string DeletedShareVersion { get => _deletedShareBody.Version ?? null; set => _deletedShareBody.Version = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesRestore' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesRestoreViaIdentity(InputObject.Id, _deletedShareBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesRestore(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, _deletedShareBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_deletedShareBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RestoreAzStorageFileShare_RestoreViaIdentityExpanded() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_deletedShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_deletedShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_Revoke.cs b/swaggerci/storage/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_Revoke.cs new file mode 100644 index 000000000000..921aca7f5a41 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_Revoke.cs @@ -0,0 +1,359 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Revoke user delegation keys. + /// + /// [OpenAPI] RevokeUserDelegationKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsSecurity.Revoke, @"AzStorageAccountUserDelegationKey_Revoke", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Revoke user delegation keys.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RevokeAzStorageAccountUserDelegationKey_Revoke : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRevokeUserDelegationKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsRevokeUserDelegationKeys(ResourceGroupName, AccountName, SubscriptionId, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RevokeAzStorageAccountUserDelegationKey_Revoke() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity.cs b/swaggerci/storage/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity.cs new file mode 100644 index 000000000000..fdfbba298d3a --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity.cs @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Revoke user delegation keys. + /// + /// [OpenAPI] RevokeUserDelegationKeys=>POST:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/revokeUserDelegationKeys" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsSecurity.Revoke, @"AzStorageAccountUserDelegationKey_RevokeViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(bool))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Revoke user delegation keys.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// When specified, forces the cmdlet return a 'bool' given that there isn't a return type by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Returns true when the command succeeds")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter PassThru { get; set; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsRevokeUserDelegationKeys' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsRevokeUserDelegationKeysViaIdentity(InputObject.Id, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsRevokeUserDelegationKeys(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public RevokeAzStorageAccountUserDelegationKey_RevokeViaIdentity() + { + + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / + if (true == MyInvocation?.BoundParameters?.ContainsKey("PassThru")) + { + WriteObject(true); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_Check.cs b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_Check.cs new file mode 100644 index 000000000000..a4786e621381 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_Check.cs @@ -0,0 +1,334 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Checks that the storage account name is valid and is not already in use. + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzStorageAccountNameAvailability_Check", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Checks that the storage account name is valid and is not already in use.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class TestAzStorageAccountNameAvailability_Check : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters _accountName; + + /// The parameters used to check the availability of the storage account name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters used to check the availability of the storage account name.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters used to check the availability of the storage account name.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsCheckNameAvailability(SubscriptionId, AccountName, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,body=AccountName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzStorageAccountNameAvailability_Check() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckExpanded.cs b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckExpanded.cs new file mode 100644 index 000000000000..de90a5b09cfb --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckExpanded.cs @@ -0,0 +1,335 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Checks that the storage account name is valid and is not already in use. + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzStorageAccountNameAvailability_CheckExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Checks that the storage account name is valid and is not already in use.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class TestAzStorageAccountNameAvailability_CheckExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// The parameters used to check the availability of the storage account name. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters _accountNameBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCheckNameAvailabilityParameters(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The storage account name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _accountNameBody.Name ?? null; set => _accountNameBody.Name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsCheckNameAvailability(SubscriptionId, _accountNameBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { SubscriptionId=SubscriptionId,body=_accountNameBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzStorageAccountNameAvailability_CheckExpanded() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentity.cs b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentity.cs new file mode 100644 index 000000000000..7eac113717be --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentity.cs @@ -0,0 +1,336 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Checks that the storage account name is valid and is not already in use. + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzStorageAccountNameAvailability_CheckViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Checks that the storage account name is valid and is not already in use.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class TestAzStorageAccountNameAvailability_CheckViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters _accountName; + + /// The parameters used to check the availability of the storage account name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The parameters used to check the availability of the storage account name.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The parameters used to check the availability of the storage account name.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsCheckNameAvailabilityViaIdentity(InputObject.Id, AccountName, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsCheckNameAvailability(InputObject.SubscriptionId ?? null, AccountName, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=AccountName}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzStorageAccountNameAvailability_CheckViaIdentity() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded.cs new file mode 100644 index 000000000000..b875759d9d47 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded.cs @@ -0,0 +1,337 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Checks that the storage account name is valid and is not already in use. + /// + /// [OpenAPI] CheckNameAvailability=>POST:"/subscriptions/{subscriptionId}/providers/Microsoft.Storage/checkNameAvailability" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsDiagnostic.Test, @"AzStorageAccountNameAvailability_CheckViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Checks that the storage account name is valid and is not already in use.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// The parameters used to check the availability of the storage account name. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountCheckNameAvailabilityParameters _accountNameBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountCheckNameAvailabilityParameters(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// The storage account name. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The storage account name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The storage account name.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string Name { get => _accountNameBody.Name ?? null; set => _accountNameBody.Name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsCheckNameAvailability' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsCheckNameAvailabilityViaIdentity(InputObject.Id, _accountNameBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsCheckNameAvailability(InputObject.SubscriptionId ?? null, _accountNameBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_accountNameBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public TestAzStorageAccountNameAvailability_CheckViaIdentityExpanded() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICheckNameAvailabilityResult + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageAccount_UpdateExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageAccount_UpdateExpanded.cs new file mode 100644 index 000000000000..603ddc4b7e5d --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageAccount_UpdateExpanded.cs @@ -0,0 +1,952 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also + /// be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change + /// of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered + /// before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys + /// for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name + /// of the storage account cannot be changed after creation. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageAccount_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageAccount_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The parameters that can be provided when updating the storage account properties. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParameters(); + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier AccessTier { get => _parametersBody.AccessTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier)""); set => _parametersBody.AccessTier = value; } + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Specifies the Active Directory account type for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory account type for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType ActiveDirectoryPropertyAccountType { get => _parametersBody.ActiveDirectoryPropertyAccountType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); set => _parametersBody.ActiveDirectoryPropertyAccountType = value; } + + /// Specifies the security identifier (SID) for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the security identifier (SID) for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyAzureStorageSid { get => _parametersBody.ActiveDirectoryPropertyAzureStorageSid ?? null; set => _parametersBody.ActiveDirectoryPropertyAzureStorageSid = value; } + + /// Specifies the domain GUID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the domain GUID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainGuid { get => _parametersBody.ActiveDirectoryPropertyDomainGuid ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainGuid = value; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the primary domain that the AD DNS server is authoritative for.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainName { get => _parametersBody.ActiveDirectoryPropertyDomainName ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainName = value; } + + /// Specifies the security identifier (SID). + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the security identifier (SID).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainSid { get => _parametersBody.ActiveDirectoryPropertyDomainSid ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainSid = value; } + + /// Specifies the Active Directory forest to get. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory forest to get.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyForestName { get => _parametersBody.ActiveDirectoryPropertyForestName ?? null; set => _parametersBody.ActiveDirectoryPropertyForestName = value; } + + /// Specifies the NetBIOS domain name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the NetBIOS domain name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyNetBiosDomainName { get => _parametersBody.ActiveDirectoryPropertyNetBiosDomainName ?? null; set => _parametersBody.ActiveDirectoryPropertyNetBiosDomainName = value; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory SAMAccountName for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertySamAccountName { get => _parametersBody.ActiveDirectoryPropertySamAccountName ?? null; set => _parametersBody.ActiveDirectoryPropertySamAccountName = value; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowBlobPublicAccess { get => _parametersBody.AllowBlobPublicAccess ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowBlobPublicAccess = value; } + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowCrossTenantReplication { get => _parametersBody.AllowCrossTenantReplication ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowCrossTenantReplication = value; } + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowSharedKeyAccess { get => _parametersBody.AllowSharedKeyAccess ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowSharedKeyAccess = value; } + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope AllowedCopyScope { get => _parametersBody.AllowedCopyScope ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope)""); set => _parametersBody.AllowedCopyScope = value; } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Default share permission for users using Kerberos authentication if RBAC role is not assigned.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => _parametersBody.AzureFileIdentityBasedAuthenticationDefaultSharePermission ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); set => _parametersBody.AzureFileIdentityBasedAuthenticationDefaultSharePermission = value; } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the directory service used. Note that this enum may be extended in the future.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => _parametersBody.AzureFileIdentityBasedAuthenticationDirectoryServiceOption ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); set => _parametersBody.AzureFileIdentityBasedAuthenticationDirectoryServiceOption = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string CustomDomainName { get => _parametersBody.CustomDomainName ?? null; set => _parametersBody.CustomDomainName = value; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter CustomDomainUseSubDomainName { get => _parametersBody.CustomDomainUseSubDomainName ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.CustomDomainUseSubDomainName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DefaultToOAuthAuthentication { get => _parametersBody.DefaultToOAuthAuthentication ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.DefaultToOAuthAuthentication = value; } + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType DnsEndpointType { get => _parametersBody.DnsEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); set => _parametersBody.DnsEndpointType = value; } + + /// Allows https traffic only to storage service if sets to true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows https traffic only to storage service if sets to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableHttpsTrafficOnly { get => _parametersBody.EnableHttpsTrafficOnly ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableHttpsTrafficOnly = value; } + + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => _parametersBody.Encryption ?? null /* object */; set => _parametersBody.Encryption = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The identity type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The identity type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType IdentityType { get => _parametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType)""); set => _parametersBody.IdentityType = value; } + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => _parametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _parametersBody.IdentityUserAssignedIdentity = value; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmutabilityPolicyAllowProtectedAppendWrite { get => _parametersBody.ImmutabilityPolicyAllowProtectedAppendWrite ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImmutabilityPolicyAllowProtectedAppendWrite = value; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutability period for the blobs in the container since the policy creation, in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + public int ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => _parametersBody.ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ?? default(int); set => _parametersBody.ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value; } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState ImmutabilityPolicyState { get => _parametersBody.ImmutabilityPolicyState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); set => _parametersBody.ImmutabilityPolicyState = value; } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmutableStorageWithVersioningEnabled { get => _parametersBody.ImmutableStorageWithVersioningEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImmutableStorageWithVersioningEnabled = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Enables local users feature, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables local users feature, if set to true")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsLocalUserEnabled { get => _parametersBody.IsLocalUserEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IsLocalUserEnabled = value; } + + /// Enables Secure File Transfer Protocol, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables Secure File Transfer Protocol, if set to true")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsSftpEnabled { get => _parametersBody.IsSftpEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IsSftpEnabled = value; } + + /// The key expiration period in days. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The key expiration period in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + public int KeyPolicyKeyExpirationPeriodInDay { get => _parametersBody.KeyPolicyKeyExpirationPeriodInDay ?? default(int); set => _parametersBody.KeyPolicyKeyExpirationPeriodInDay = value; } + + /// + /// Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind Kind { get => _parametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind)""); set => _parametersBody.Kind = value; } + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState LargeFileSharesState { get => _parametersBody.LargeFileSharesState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState)""); set => _parametersBody.LargeFileSharesState = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion MinimumTlsVersion { get => _parametersBody.MinimumTlsVersion ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion)""); set => _parametersBody.MinimumTlsVersion = value; } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, \"Logging, Metrics\"), or None to bypass none of those traffics.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass NetworkRuleSetBypass { get => _parametersBody.NetworkRuleSetBypass ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); set => _parametersBody.NetworkRuleSetBypass = value; } + + /// Specifies the default action of allow or deny when no other rules match. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the default action of allow or deny when no other rules match.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction NetworkRuleSetDefaultAction { get => _parametersBody.NetworkRuleSetDefaultAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); set => _parametersBody.NetworkRuleSetDefaultAction = value; } + + /// Sets the IP ACL rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the IP ACL rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => _parametersBody.NetworkRuleSetIPRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetIPRule = value; } + + /// Sets the resource access rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the resource access rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => _parametersBody.NetworkRuleSetResourceAccessRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetResourceAccessRule = value; } + + /// Sets the virtual network rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the virtual network rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => _parametersBody.NetworkRuleSetVirtualNetworkRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetVirtualNetworkRule = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess)""); set => _parametersBody.PublicNetworkAccess = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether internet routing storage endpoints are to be published")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RoutingPreferencePublishInternetEndpoint { get => _parametersBody.RoutingPreferencePublishInternetEndpoint ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.RoutingPreferencePublishInternetEndpoint = value; } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether microsoft routing storage endpoints are to be published")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RoutingPreferencePublishMicrosoftEndpoint { get => _parametersBody.RoutingPreferencePublishMicrosoftEndpoint ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.RoutingPreferencePublishMicrosoftEndpoint = value; } + + /// Routing Choice defines the kind of network routing opted by the user. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Routing Choice defines the kind of network routing opted by the user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice RoutingPreferenceRoutingChoice { get => _parametersBody.RoutingPreferenceRoutingChoice ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); set => _parametersBody.RoutingPreferenceRoutingChoice = value; } + + /// The SAS expiration period, DD.HH:MM:SS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS expiration period, DD.HH:MM:SS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + public string SasPolicySasExpirationPeriod { get => _parametersBody.SasPolicySasExpirationPeriod ?? null; set => _parametersBody.SasPolicySasExpirationPeriod = value; } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName SkuName { get => _parametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); set => _parametersBody.SkuName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.StorageAccountsUpdate(ResourceGroupName, AccountName, SubscriptionId, _parametersBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageAccount_UpdateExpanded() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageAccount_UpdateViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageAccount_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..4b0270092eaa --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageAccount_UpdateViaIdentityExpanded.cs @@ -0,0 +1,929 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also + /// be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change + /// of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered + /// before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys + /// for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name + /// of the storage account cannot be changed after creation. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageAccount_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"The update operation can be used to update the SKU, encryption, access tier, or tags for a storage account. It can also be used to map the account to a custom domain. Only one custom domain is supported per storage account; the replacement/change of custom domain is not supported. In order to replace an old custom domain, the old value must be cleared/unregistered before a new value can be set. The update of multiple properties is supported. This call does not change the storage keys for the account. If you want to change the storage account keys, use the regenerate keys operation. The location and name of the storage account cannot be changed after creation.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageAccount_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// + /// The parameters that can be provided when updating the storage account properties. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParameters _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageAccountUpdateParameters(); + + /// + /// Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier + /// is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs + /// storage account type. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Required for storage accounts where kind = BlobStorage. The access tier is used for billing. The 'Premium' access tier is the default value for premium block blobs storage account type and it cannot be changed for the premium block blobs storage account type.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier AccessTier { get => _parametersBody.AccessTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccessTier)""); set => _parametersBody.AccessTier = value; } + + /// Specifies the Active Directory account type for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory account type for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory account type for Azure Storage.", + SerializedName = @"accountType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType ActiveDirectoryPropertyAccountType { get => _parametersBody.ActiveDirectoryPropertyAccountType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountType)""); set => _parametersBody.ActiveDirectoryPropertyAccountType = value; } + + /// Specifies the security identifier (SID) for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the security identifier (SID) for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID) for Azure Storage.", + SerializedName = @"azureStorageSid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyAzureStorageSid { get => _parametersBody.ActiveDirectoryPropertyAzureStorageSid ?? null; set => _parametersBody.ActiveDirectoryPropertyAzureStorageSid = value; } + + /// Specifies the domain GUID. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the domain GUID.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the domain GUID.", + SerializedName = @"domainGuid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainGuid { get => _parametersBody.ActiveDirectoryPropertyDomainGuid ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainGuid = value; } + + /// Specifies the primary domain that the AD DNS server is authoritative for. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the primary domain that the AD DNS server is authoritative for.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the primary domain that the AD DNS server is authoritative for.", + SerializedName = @"domainName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainName { get => _parametersBody.ActiveDirectoryPropertyDomainName ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainName = value; } + + /// Specifies the security identifier (SID). + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the security identifier (SID).")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the security identifier (SID).", + SerializedName = @"domainSid", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyDomainSid { get => _parametersBody.ActiveDirectoryPropertyDomainSid ?? null; set => _parametersBody.ActiveDirectoryPropertyDomainSid = value; } + + /// Specifies the Active Directory forest to get. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory forest to get.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory forest to get.", + SerializedName = @"forestName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyForestName { get => _parametersBody.ActiveDirectoryPropertyForestName ?? null; set => _parametersBody.ActiveDirectoryPropertyForestName = value; } + + /// Specifies the NetBIOS domain name. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the NetBIOS domain name.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the NetBIOS domain name.", + SerializedName = @"netBiosDomainName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertyNetBiosDomainName { get => _parametersBody.ActiveDirectoryPropertyNetBiosDomainName ?? null; set => _parametersBody.ActiveDirectoryPropertyNetBiosDomainName = value; } + + /// Specifies the Active Directory SAMAccountName for Azure Storage. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the Active Directory SAMAccountName for Azure Storage.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the Active Directory SAMAccountName for Azure Storage.", + SerializedName = @"samAccountName", + PossibleTypes = new [] { typeof(string) })] + public string ActiveDirectoryPropertySamAccountName { get => _parametersBody.ActiveDirectoryPropertySamAccountName ?? null; set => _parametersBody.ActiveDirectoryPropertySamAccountName = value; } + + /// + /// Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true + /// for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public access to all blobs or containers in the storage account. The default interpretation is true for this property.", + SerializedName = @"allowBlobPublicAccess", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowBlobPublicAccess { get => _parametersBody.AllowBlobPublicAccess ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowBlobPublicAccess = value; } + + /// + /// Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow cross AAD tenant object replication. The default interpretation is true for this property.", + SerializedName = @"allowCrossTenantReplication", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowCrossTenantReplication { get => _parametersBody.AllowCrossTenantReplication ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowCrossTenantReplication = value; } + + /// + /// Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If + /// false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). + /// The default value is null, which is equivalent to true. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether the storage account permits requests to be authorized with the account access key via Shared Key. If false, then all requests, including shared access signatures, must be authorized with Azure Active Directory (Azure AD). The default value is null, which is equivalent to true.", + SerializedName = @"allowSharedKeyAccess", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter AllowSharedKeyAccess { get => _parametersBody.AllowSharedKeyAccess ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.AllowSharedKeyAccess = value; } + + /// + /// Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Restrict copy to and from Storage Accounts within an AAD tenant or with Private Links to the same VNet.", + SerializedName = @"allowedCopyScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope AllowedCopyScope { get => _parametersBody.AllowedCopyScope ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AllowedCopyScope)""); set => _parametersBody.AllowedCopyScope = value; } + + /// + /// Default share permission for users using Kerberos authentication if RBAC role is not assigned. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Default share permission for users using Kerberos authentication if RBAC role is not assigned.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Default share permission for users using Kerberos authentication if RBAC role is not assigned.", + SerializedName = @"defaultSharePermission", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission AzureFileIdentityBasedAuthenticationDefaultSharePermission { get => _parametersBody.AzureFileIdentityBasedAuthenticationDefaultSharePermission ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultSharePermission)""); set => _parametersBody.AzureFileIdentityBasedAuthenticationDefaultSharePermission = value; } + + /// + /// Indicates the directory service used. Note that this enum may be extended in the future. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates the directory service used. Note that this enum may be extended in the future.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates the directory service used. Note that this enum may be extended in the future.", + SerializedName = @"directoryServiceOptions", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions AzureFileIdentityBasedAuthenticationDirectoryServiceOption { get => _parametersBody.AzureFileIdentityBasedAuthenticationDirectoryServiceOption ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DirectoryServiceOptions)""); set => _parametersBody.AzureFileIdentityBasedAuthenticationDirectoryServiceOption = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets the custom domain name assigned to the storage account. Name is the CNAME source.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(string) })] + public string CustomDomainName { get => _parametersBody.CustomDomainName ?? null; set => _parametersBody.CustomDomainName = value; } + + /// + /// Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Indicates whether indirect CName validation is enabled. Default value is false. This should only be set on updates.", + SerializedName = @"useSubDomainName", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter CustomDomainUseSubDomainName { get => _parametersBody.CustomDomainUseSubDomainName ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.CustomDomainUseSubDomainName = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false + /// for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether the default authentication is OAuth or not. The default interpretation is false for this property.", + SerializedName = @"defaultToOAuthAuthentication", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter DefaultToOAuthAuthentication { get => _parametersBody.DefaultToOAuthAuthentication ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.DefaultToOAuthAuthentication = value; } + + /// + /// Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single + /// subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows you to specify the type of endpoint. Set this to AzureDNSZone to create a large number of accounts in a single subscription, which creates accounts in an Azure DNS Zone and the endpoint URL will have an alphanumeric DNS Zone identifier.", + SerializedName = @"dnsEndpointType", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType DnsEndpointType { get => _parametersBody.DnsEndpointType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DnsEndpointType)""); set => _parametersBody.DnsEndpointType = value; } + + /// Allows https traffic only to storage service if sets to true. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allows https traffic only to storage service if sets to true.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allows https traffic only to storage service if sets to true.", + SerializedName = @"supportsHttpsTrafficOnly", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EnableHttpsTrafficOnly { get => _parametersBody.EnableHttpsTrafficOnly ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.EnableHttpsTrafficOnly = value; } + + /// + /// Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Not applicable. Azure Storage encryption at rest is enabled by default for all storage accounts and cannot be disabled.", + SerializedName = @"encryption", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryption Encryption { get => _parametersBody.Encryption ?? null /* object */; set => _parametersBody.Encryption = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// The identity type. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The identity type.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The identity type.", + SerializedName = @"type", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType IdentityType { get => _parametersBody.IdentityType ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.IdentityType)""); set => _parametersBody.IdentityType = value; } + + /// + /// Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage + /// account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the set of User Assigned identities that will be used with this storage account. The key is the ARM resource identifier of the identity. Only 1 User Assigned identity is permitted here.", + SerializedName = @"userAssignedIdentities", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIdentityUserAssignedIdentities IdentityUserAssignedIdentity { get => _parametersBody.IdentityUserAssignedIdentity ?? null /* object */; set => _parametersBody.IdentityUserAssignedIdentity = value; } + + /// + /// This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can + /// be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and + /// any existing blocks cannot be modified or deleted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"This property can only be changed for disabled and unlocked time-based retention policies. When enabled, new blocks can be written to an append blob while maintaining immutability protection and compliance. Only new blocks can be added and any existing blocks cannot be modified or deleted.", + SerializedName = @"allowProtectedAppendWrites", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmutabilityPolicyAllowProtectedAppendWrite { get => _parametersBody.ImmutabilityPolicyAllowProtectedAppendWrite ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImmutabilityPolicyAllowProtectedAppendWrite = value; } + + /// + /// The immutability period for the blobs in the container since the policy creation, in days. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The immutability period for the blobs in the container since the policy creation, in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The immutability period for the blobs in the container since the policy creation, in days.", + SerializedName = @"immutabilityPeriodSinceCreationInDays", + PossibleTypes = new [] { typeof(int) })] + public int ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay { get => _parametersBody.ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay ?? default(int); set => _parametersBody.ImmutabilityPolicyImmutabilityPeriodSinceCreationInDay = value; } + + /// + /// The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows + /// increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked + /// state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked + /// state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which + /// cannot be reverted. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The ImmutabilityPolicy state defines the mode of the policy. Disabled state disables the policy, Unlocked state allows increase and decrease of immutability retention time and also allows toggling allowProtectedAppendWrites property, Locked state only allows the increase of the immutability retention time. A policy can only be created in a Disabled or Unlocked state and can be toggled between the two states. Only a policy in an Unlocked state can transition to a Locked state which cannot be reverted.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState ImmutabilityPolicyState { get => _parametersBody.ImmutabilityPolicyState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.AccountImmutabilityPolicyState)""); set => _parametersBody.ImmutabilityPolicyState = value; } + + /// + /// A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability + /// enabled by default. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which enables account-level immutability. All the containers under such an account have object-level immutability enabled by default.", + SerializedName = @"enabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter ImmutableStorageWithVersioningEnabled { get => _parametersBody.ImmutableStorageWithVersioningEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.ImmutableStorageWithVersioningEnabled = value; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// Enables local users feature, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables local users feature, if set to true")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables local users feature, if set to true", + SerializedName = @"isLocalUserEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsLocalUserEnabled { get => _parametersBody.IsLocalUserEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IsLocalUserEnabled = value; } + + /// Enables Secure File Transfer Protocol, if set to true + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Enables Secure File Transfer Protocol, if set to true")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Enables Secure File Transfer Protocol, if set to true", + SerializedName = @"isSftpEnabled", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter IsSftpEnabled { get => _parametersBody.IsSftpEnabled ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.IsSftpEnabled = value; } + + /// The key expiration period in days. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The key expiration period in days.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The key expiration period in days.", + SerializedName = @"keyExpirationPeriodInDays", + PossibleTypes = new [] { typeof(int) })] + public int KeyPolicyKeyExpirationPeriodInDay { get => _parametersBody.KeyPolicyKeyExpirationPeriodInDay ?? default(int); set => _parametersBody.KeyPolicyKeyExpirationPeriodInDay = value; } + + /// + /// Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Optional. Indicates the type of storage account. Currently only StorageV2 value supported by server.", + SerializedName = @"kind", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind Kind { get => _parametersBody.Kind ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Kind)""); set => _parametersBody.Kind = value; } + + /// + /// Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow large file shares if sets to Enabled. It cannot be disabled once it is enabled.", + SerializedName = @"largeFileSharesState", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState LargeFileSharesState { get => _parametersBody.LargeFileSharesState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.LargeFileSharesState)""); set => _parametersBody.LargeFileSharesState = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Set the minimum TLS version to be permitted on requests to storage. The default interpretation is TLS 1.0 for this property.", + SerializedName = @"minimumTlsVersion", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion MinimumTlsVersion { get => _parametersBody.MinimumTlsVersion ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.MinimumTlsVersion)""); set => _parametersBody.MinimumTlsVersion = value; } + + /// + /// Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices + /// (For example, "Logging, Metrics"), or None to bypass none of those traffics. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, \"Logging, Metrics\"), or None to bypass none of those traffics.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, ""Logging, Metrics""), or None to bypass none of those traffics.", + SerializedName = @"bypass", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass NetworkRuleSetBypass { get => _parametersBody.NetworkRuleSetBypass ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.Bypass)""); set => _parametersBody.NetworkRuleSetBypass = value; } + + /// Specifies the default action of allow or deny when no other rules match. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Specifies the default action of allow or deny when no other rules match.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Specifies the default action of allow or deny when no other rules match.", + SerializedName = @"defaultAction", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction NetworkRuleSetDefaultAction { get => _parametersBody.NetworkRuleSetDefaultAction ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.DefaultAction)""); set => _parametersBody.NetworkRuleSetDefaultAction = value; } + + /// Sets the IP ACL rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the IP ACL rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the IP ACL rules", + SerializedName = @"ipRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IIPRule[] NetworkRuleSetIPRule { get => _parametersBody.NetworkRuleSetIPRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetIPRule = value; } + + /// Sets the resource access rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the resource access rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the resource access rules", + SerializedName = @"resourceAccessRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IResourceAccessRule[] NetworkRuleSetResourceAccessRule { get => _parametersBody.NetworkRuleSetResourceAccessRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetResourceAccessRule = value; } + + /// Sets the virtual network rules + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Sets the virtual network rules")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Sets the virtual network rules", + SerializedName = @"virtualNetworkRules", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IVirtualNetworkRule[] NetworkRuleSetVirtualNetworkRule { get => _parametersBody.NetworkRuleSetVirtualNetworkRule ?? null /* arrayOf */; set => _parametersBody.NetworkRuleSetVirtualNetworkRule = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Allow or disallow public network access to Storage Account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'.", + SerializedName = @"publicNetworkAccess", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess PublicNetworkAccess { get => _parametersBody.PublicNetworkAccess ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.PublicNetworkAccess)""); set => _parametersBody.PublicNetworkAccess = value; } + + /// + /// A boolean flag which indicates whether internet routing storage endpoints are to be published + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether internet routing storage endpoints are to be published")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether internet routing storage endpoints are to be published", + SerializedName = @"publishInternetEndpoints", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RoutingPreferencePublishInternetEndpoint { get => _parametersBody.RoutingPreferencePublishInternetEndpoint ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.RoutingPreferencePublishInternetEndpoint = value; } + + /// + /// A boolean flag which indicates whether microsoft routing storage endpoints are to be published + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean flag which indicates whether microsoft routing storage endpoints are to be published")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean flag which indicates whether microsoft routing storage endpoints are to be published", + SerializedName = @"publishMicrosoftEndpoints", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter RoutingPreferencePublishMicrosoftEndpoint { get => _parametersBody.RoutingPreferencePublishMicrosoftEndpoint ?? default(global::System.Management.Automation.SwitchParameter); set => _parametersBody.RoutingPreferencePublishMicrosoftEndpoint = value; } + + /// Routing Choice defines the kind of network routing opted by the user. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Routing Choice defines the kind of network routing opted by the user.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Routing Choice defines the kind of network routing opted by the user.", + SerializedName = @"routingChoice", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice RoutingPreferenceRoutingChoice { get => _parametersBody.RoutingPreferenceRoutingChoice ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RoutingChoice)""); set => _parametersBody.RoutingPreferenceRoutingChoice = value; } + + /// The SAS expiration period, DD.HH:MM:SS. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SAS expiration period, DD.HH:MM:SS.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SAS expiration period, DD.HH:MM:SS.", + SerializedName = @"sasExpirationPeriod", + PossibleTypes = new [] { typeof(string) })] + public string SasPolicySasExpirationPeriod { get => _parametersBody.SasPolicySasExpirationPeriod ?? null; set => _parametersBody.SasPolicySasExpirationPeriod = value; } + + /// + /// The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The SKU name. Required for account creation; optional for update. Note that in older versions, SKU name was called accountType.", + SerializedName = @"name", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName SkuName { get => _parametersBody.SkuName ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.SkuName)""); set => _parametersBody.SkuName = value; } + + /// + /// Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this + /// resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater + /// in length than 128 characters and a value no greater in length than 256 characters. + /// + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters.", + SerializedName = @"tags", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccountUpdateParametersTags Tag { get => _parametersBody.Tag ?? null /* object */; set => _parametersBody.Tag = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'StorageAccountsUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.StorageAccountsUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.StorageAccountsUpdate(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, _parametersBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageAccount_UpdateViaIdentityExpanded() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageAccount + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateExpanded.cs new file mode 100644 index 000000000000..7edfb5f35302 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateExpanded.cs @@ -0,0 +1,391 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. + /// Update fails if the specified container doesn't already exist. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageBlobContainer_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageBlobContainer_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// Properties of the blob container, including Id, resource name, resource type, Etag. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer _blobContainerBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Backing field for property. + private string _containerName; + + /// + /// The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the blob container within the specified storage account. Blob container names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"containerName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ContainerName { get => this._containerName; set => this._containerName = value; } + + /// Properties of the blob container. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Properties of the blob container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Properties of the blob container.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties ContainerProperty { get => _blobContainerBody.ContainerProperty ?? null /* object */; set => _blobContainerBody.ContainerProperty = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.BlobContainersUpdate(ResourceGroupName, AccountName, ContainerName, SubscriptionId, _blobContainerBody, onOk, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ContainerName=ContainerName,SubscriptionId=SubscriptionId,body=_blobContainerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageBlobContainer_UpdateExpanded() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..f0cd58fa7153 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded.cs @@ -0,0 +1,354 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. + /// Update fails if the specified container doesn't already exist. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/blobServices/default/containers/{containerName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageBlobContainer_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Updates container properties as specified in request body. Properties not mentioned in the request will be unchanged. Update fails if the specified container doesn't already exist. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// Properties of the blob container, including Id, resource name, resource type, Etag. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer _blobContainerBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.BlobContainer(); + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// Properties of the blob container. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Properties of the blob container.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Properties of the blob container.", + SerializedName = @"properties", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IContainerProperties ContainerProperty { get => _blobContainerBody.ContainerProperty ?? null /* object */; set => _blobContainerBody.ContainerProperty = value; } + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'BlobContainersUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.BlobContainersUpdateViaIdentity(InputObject.Id, _blobContainerBody, onOk, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ContainerName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ContainerName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.BlobContainersUpdate(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ContainerName ?? null, InputObject.SubscriptionId ?? null, _blobContainerBody, onOk, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_blobContainerBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageBlobContainer_UpdateViaIdentityExpanded() + { + + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IBlobContainer + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_Patch.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_Patch.cs new file mode 100644 index 000000000000..556f07977fc0 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_Patch.cs @@ -0,0 +1,443 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does + /// not already exist. + /// + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageEncryptionScope_Patch", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageEncryptionScope_Patch : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope _encryptionScope; + + /// The Encryption Scope resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Encryption Scope resource.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Encryption Scope resource.", + SerializedName = @"encryptionScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope EncryptionScope { get => this._encryptionScope; set => this._encryptionScope = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 + /// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately + /// preceded and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"encryptionScopeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EncryptionScopeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EncryptionScopesPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EncryptionScopesPatch(ResourceGroupName, AccountName, SubscriptionId, Name, EncryptionScope, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name,body=EncryptionScope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageEncryptionScope_Patch() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=EncryptionScope }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=EncryptionScope }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchExpanded.cs new file mode 100644 index 000000000000..83319d955314 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchExpanded.cs @@ -0,0 +1,489 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does + /// not already exist. + /// + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageEncryptionScope_PatchExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageEncryptionScope_PatchExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The Encryption Scope resource. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope _encryptionScopeBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest.", + SerializedName = @"requireInfrastructureEncryption", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EncryptionScopePropertyRequireInfrastructureEncryption { get => _encryptionScopeBody.PropertyRequireInfrastructureEncryption ?? default(global::System.Management.Automation.SwitchParameter); set => _encryptionScopeBody.PropertyRequireInfrastructureEncryption = value; } + + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource EncryptionScopePropertySource { get => _encryptionScopeBody.PropertySource ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource)""); set => _encryptionScopeBody.PropertySource = value; } + + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState EncryptionScopePropertyState { get => _encryptionScopeBody.PropertyState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState)""); set => _encryptionScopeBody.PropertyState = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope.", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + public string KeyVaultPropertyKeyUri { get => _encryptionScopeBody.KeyVaultPropertyKeyUri ?? null; set => _encryptionScopeBody.KeyVaultPropertyKeyUri = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 + /// characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately + /// preceded and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the encryption scope within the specified storage account. Encryption scope names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"encryptionScopeName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("EncryptionScopeName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EncryptionScopesPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.EncryptionScopesPatch(ResourceGroupName, AccountName, SubscriptionId, Name, _encryptionScopeBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name,body=_encryptionScopeBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageEncryptionScope_PatchExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_encryptionScopeBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_encryptionScopeBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentity.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentity.cs new file mode 100644 index 000000000000..1ded04cc9e10 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentity.cs @@ -0,0 +1,405 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does + /// not already exist. + /// + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageEncryptionScope_PatchViaIdentity", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageEncryptionScope_PatchViaIdentity : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope _encryptionScope; + + /// The Encryption Scope resource. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The Encryption Scope resource.", ValueFromPipeline = true)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The Encryption Scope resource.", + SerializedName = @"encryptionScope", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope EncryptionScope { get => this._encryptionScope; set => this._encryptionScope = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EncryptionScopesPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EncryptionScopesPatchViaIdentity(InputObject.Id, EncryptionScope, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EncryptionScopeName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EncryptionScopeName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EncryptionScopesPatch(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.EncryptionScopeName ?? null, EncryptionScope, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EncryptionScope}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageEncryptionScope_PatchViaIdentity() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EncryptionScope }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=EncryptionScope }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded.cs new file mode 100644 index 000000000000..c5d4c91c2c07 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded.cs @@ -0,0 +1,451 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does + /// not already exist. + /// + /// + /// [OpenAPI] Patch=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/encryptionScopes/{encryptionScopeName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageEncryptionScope_PatchViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Update encryption scope properties as specified in the request body. Update fails if the specified encryption scope does not already exist.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// The Encryption Scope resource. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope _encryptionScopeBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.EncryptionScope(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for + /// data at rest. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest.", + SerializedName = @"requireInfrastructureEncryption", + PossibleTypes = new [] { typeof(global::System.Management.Automation.SwitchParameter) })] + public global::System.Management.Automation.SwitchParameter EncryptionScopePropertyRequireInfrastructureEncryption { get => _encryptionScopeBody.PropertyRequireInfrastructureEncryption ?? default(global::System.Management.Automation.SwitchParameter); set => _encryptionScopeBody.PropertyRequireInfrastructureEncryption = value; } + + /// + /// The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The provider for the encryption scope. Possible values (case-insensitive): Microsoft.Storage, Microsoft.KeyVault.", + SerializedName = @"source", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource EncryptionScopePropertySource { get => _encryptionScopeBody.PropertySource ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeSource)""); set => _encryptionScopeBody.PropertySource = value; } + + /// + /// The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The state of the encryption scope. Possible values (case-insensitive): Enabled, Disabled.", + SerializedName = @"state", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState EncryptionScopePropertyState { get => _encryptionScopeBody.PropertyState ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EncryptionScopeState)""); set => _encryptionScopeBody.PropertyState = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the + /// identifier to enable customer-managed key support on this encryption scope. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The object identifier for a key vault key object. When applied, the encryption scope will use the key referenced by the identifier to enable customer-managed key support on this encryption scope.", + SerializedName = @"keyUri", + PossibleTypes = new [] { typeof(string) })] + public string KeyVaultPropertyKeyUri { get => _encryptionScopeBody.KeyVaultPropertyKeyUri ?? null; set => _encryptionScopeBody.KeyVaultPropertyKeyUri = value; } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'EncryptionScopesPatch' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.EncryptionScopesPatchViaIdentity(InputObject.Id, _encryptionScopeBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.EncryptionScopeName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.EncryptionScopeName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.EncryptionScopesPatch(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.EncryptionScopeName ?? null, _encryptionScopeBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_encryptionScopeBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageEncryptionScope_PatchViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IErrorResponse + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_encryptionScopeBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_encryptionScopeBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IEncryptionScope + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageFileShare_UpdateExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageFileShare_UpdateExpanded.cs new file mode 100644 index 000000000000..bfc47fa0209f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageFileShare_UpdateExpanded.cs @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update + /// fails if the specified share does not already exist. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageFileShare_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageFileShare_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Properties of the file share, including Id, resource name, resource type, Etag. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare _fileShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier FileSharePropertyAccessTier { get => _fileShareBody.PropertyAccessTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier)""); set => _fileShareBody.PropertyAccessTier = value; } + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authentication protocol that is used for the file share. Can only be specified when creating a share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication protocol that is used for the file share. Can only be specified when creating a share.", + SerializedName = @"enabledProtocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols FileSharePropertyEnabledProtocol { get => _fileShareBody.PropertyEnabledProtocol ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols)""); set => _fileShareBody.PropertyEnabledProtocol = value; } + + /// A name-value pair to associate with the share as metadata. + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A name-value pair to associate with the share as metadata.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the share as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata FileSharePropertyMetadata { get => _fileShareBody.PropertyMetadata ?? null /* object */; set => _fileShareBody.PropertyMetadata = value; } + + /// The property is for NFS share only. The default is NoRootSquash. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The property is for NFS share only. The default is NoRootSquash.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The property is for NFS share only. The default is NoRootSquash.", + SerializedName = @"rootSquash", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType FileSharePropertyRootSquash { get => _fileShareBody.PropertyRootSquash ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType)""); set => _fileShareBody.PropertyRootSquash = value; } + + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.", + SerializedName = @"shareQuota", + PossibleTypes = new [] { typeof(int) })] + public int FileSharePropertyShareQuota { get => _fileShareBody.PropertyShareQuota ?? default(int); set => _fileShareBody.PropertyShareQuota = value; } + + /// List of stored access policies specified on the share. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of stored access policies specified on the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the share.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] FileSharePropertySignedIdentifier { get => _fileShareBody.PropertySignedIdentifier ?? null /* arrayOf */; set => _fileShareBody.PropertySignedIdentifier = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _shareName; + + /// + /// The name of the file share within the specified storage account. File share names must be between 3 and 63 characters + /// in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded + /// and followed by a letter or number. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.", + SerializedName = @"shareName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ShareName { get => this._shareName; set => this._shareName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.FileSharesUpdate(ResourceGroupName, AccountName, ShareName, SubscriptionId, _fileShareBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,ShareName=ShareName,SubscriptionId=SubscriptionId,body=_fileShareBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageFileShare_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, ShareName=ShareName, SubscriptionId=SubscriptionId, body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageFileShare_UpdateViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageFileShare_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..b42fb14256fe --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageFileShare_UpdateViaIdentityExpanded.cs @@ -0,0 +1,474 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// + /// Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update + /// fails if the specified share does not already exist. + /// + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/fileServices/default/shares/{shareName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageFileShare_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist. ")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageFileShare_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Properties of the file share, including Id, resource name, resource type, Etag. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare _fileShareBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.FileShare(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// + /// Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage + /// account can choose Premium. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"Access tier for specific share. GpV2 account can choose between TransactionOptimized (default), Hot, and Cool. FileStorage account can choose Premium.", + SerializedName = @"accessTier", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier FileSharePropertyAccessTier { get => _fileShareBody.PropertyAccessTier ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.ShareAccessTier)""); set => _fileShareBody.PropertyAccessTier = value; } + + /// + /// The authentication protocol that is used for the file share. Can only be specified when creating a share. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The authentication protocol that is used for the file share. Can only be specified when creating a share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The authentication protocol that is used for the file share. Can only be specified when creating a share.", + SerializedName = @"enabledProtocols", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols FileSharePropertyEnabledProtocol { get => _fileShareBody.PropertyEnabledProtocol ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.EnabledProtocols)""); set => _fileShareBody.PropertyEnabledProtocol = value; } + + /// A name-value pair to associate with the share as metadata. + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A name-value pair to associate with the share as metadata.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair to associate with the share as metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileSharePropertiesMetadata FileSharePropertyMetadata { get => _fileShareBody.PropertyMetadata ?? null /* object */; set => _fileShareBody.PropertyMetadata = value; } + + /// The property is for NFS share only. The default is NoRootSquash. + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The property is for NFS share only. The default is NoRootSquash.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The property is for NFS share only. The default is NoRootSquash.", + SerializedName = @"rootSquash", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType) })] + [global::System.Management.Automation.ArgumentCompleter(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType))] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType FileSharePropertyRootSquash { get => _fileShareBody.PropertyRootSquash ?? ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Support.RootSquashType)""); set => _fileShareBody.PropertyRootSquash = value; } + + /// + /// The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File + /// Shares, the maximum size is 102400. + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"The maximum size of the share, in gigabytes. Must be greater than 0, and less than or equal to 5TB (5120). For Large File Shares, the maximum size is 102400.", + SerializedName = @"shareQuota", + PossibleTypes = new [] { typeof(int) })] + public int FileSharePropertyShareQuota { get => _fileShareBody.PropertyShareQuota ?? default(int); set => _fileShareBody.PropertyShareQuota = value; } + + /// List of stored access policies specified on the share. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of stored access policies specified on the share.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the share.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ISignedIdentifier[] FileSharePropertySignedIdentifier { get => _fileShareBody.PropertySignedIdentifier ?? null /* arrayOf */; set => _fileShareBody.PropertySignedIdentifier = value; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'FileSharesUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.FileSharesUpdateViaIdentity(InputObject.Id, _fileShareBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.ShareName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ShareName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.FileSharesUpdate(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.ShareName ?? null, InputObject.SubscriptionId ?? null, _fileShareBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_fileShareBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageFileShare_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_fileShareBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IFileShare + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageQueue_UpdateExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageQueue_UpdateExpanded.cs new file mode 100644 index 000000000000..bbfb40b91fc4 --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageQueue_UpdateExpanded.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Creates a new queue with the specified queue name, under the specified account. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageQueue_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new queue with the specified queue name, under the specified account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageQueue_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue _queueBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot + /// have two consecutive dash(-) characters. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A queue name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an alphanumeric character and it cannot have two consecutive dash(-) characters.", + SerializedName = @"queueName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("QueueName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// A name-value pair that represents queue metadata. + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A name-value pair that represents queue metadata.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair that represents queue metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata QueuePropertyMetadata { get => _queueBody.QueuePropertyMetadata ?? null /* object */; set => _queueBody.QueuePropertyMetadata = value; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueueUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.QueueUpdate(ResourceGroupName, AccountName, SubscriptionId, Name, _queueBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name,body=_queueBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageQueue_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_queueBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_queueBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageQueue_UpdateViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageQueue_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..4e2dee4a084f --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageQueue_UpdateViaIdentityExpanded.cs @@ -0,0 +1,403 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Creates a new queue with the specified queue name, under the specified account. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageQueue_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new queue with the specified queue name, under the specified account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageQueue_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue _queueBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.StorageQueue(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// A name-value pair that represents queue metadata. + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ExportAs(typeof(global::System.Collections.Hashtable))] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "A name-value pair that represents queue metadata.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"A name-value pair that represents queue metadata.", + SerializedName = @"metadata", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IQueuePropertiesMetadata QueuePropertyMetadata { get => _queueBody.QueuePropertyMetadata ?? null /* object */; set => _queueBody.QueuePropertyMetadata = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'QueueUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.QueueUpdateViaIdentity(InputObject.Id, _queueBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.QueueName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.QueueName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.QueueUpdate(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.QueueName ?? null, _queueBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_queueBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageQueue_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_queueBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_queueBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IStorageQueue + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageTable_UpdateExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageTable_UpdateExpanded.cs new file mode 100644 index 000000000000..2c5964d42ebe --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageTable_UpdateExpanded.cs @@ -0,0 +1,441 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Creates a new table with the specified table name, under the specified account. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageTable_UpdateExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new table with the specified table name, under the specified account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageTable_UpdateExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Properties of the table, including Id, resource name, resource type. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table(); + + /// Backing field for property. + private string _accountName; + + /// + /// The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters + /// in length and use numbers and lower-case letters only. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.", + SerializedName = @"accountName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string AccountName { get => this._accountName; set => this._accountName = value; } + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// Backing field for property. + private string _name; + + /// + /// A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of + /// only alphanumeric characters and it cannot begin with a numeric character. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"A table name must be unique within a storage account and must be between 3 and 63 characters.The name must comprise of only alphanumeric characters and it cannot begin with a numeric character.", + SerializedName = @"tableName", + PossibleTypes = new [] { typeof(string) })] + [global::System.Management.Automation.Alias("TableName")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string Name { get => this._name; set => this._name = value; } + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// Backing field for property. + private string _resourceGroupName; + + /// + /// The name of the resource group within the user's subscription. The name is case insensitive. + /// + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The name of the resource group within the user's subscription. The name is case insensitive.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The name of the resource group within the user's subscription. The name is case insensitive.", + SerializedName = @"resourceGroupName", + PossibleTypes = new [] { typeof(string) })] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string ResourceGroupName { get => this._resourceGroupName; set => this._resourceGroupName = value; } + + /// Backing field for property. + private string _subscriptionId; + + /// The ID of the target subscription. + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "The ID of the target subscription.")] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = true, + ReadOnly = false, + Description = @"The ID of the target subscription.", + SerializedName = @"subscriptionId", + PossibleTypes = new [] { typeof(string) })] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.DefaultInfo( + Name = @"", + Description =@"", + Script = @"(Get-AzContext).Subscription.Id")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public string SubscriptionId { get => this._subscriptionId; set => this._subscriptionId = value; } + + /// List of stored access policies specified on the table. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of stored access policies specified on the table.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the table.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] TablePropertySignedIdentifier { get => _parametersBody.PropertySignedIdentifier ?? null /* arrayOf */; set => _parametersBody.PropertySignedIdentifier = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TableUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + await this.Client.TableUpdate(ResourceGroupName, AccountName, SubscriptionId, Name, _parametersBody, onOk, onDefault, this, Pipeline); + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName,AccountName=AccountName,SubscriptionId=SubscriptionId,Name=Name,body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageTable_UpdateExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { ResourceGroupName=ResourceGroupName, AccountName=AccountName, SubscriptionId=SubscriptionId, Name=Name, body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/cmdlets/UpdateAzStorageTable_UpdateViaIdentityExpanded.cs b/swaggerci/storage/generated/cmdlets/UpdateAzStorageTable_UpdateViaIdentityExpanded.cs new file mode 100644 index 000000000000..ac682d3d11fa --- /dev/null +++ b/swaggerci/storage/generated/cmdlets/UpdateAzStorageTable_UpdateViaIdentityExpanded.cs @@ -0,0 +1,404 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Cmdlets +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + using System; + + /// Creates a new table with the specified table name, under the specified account. + /// + /// [OpenAPI] Update=>PATCH:"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}" + /// + [global::System.Management.Automation.Cmdlet(global::System.Management.Automation.VerbsData.Update, @"AzStorageTable_UpdateViaIdentityExpanded", SupportsShouldProcess = true)] + [global::System.Management.Automation.OutputType(typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable))] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Description(@"Creates a new table with the specified table name, under the specified account.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Generated] + public partial class UpdateAzStorageTable_UpdateViaIdentityExpanded : global::System.Management.Automation.PSCmdlet, + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener + { + /// A unique id generatd for the this cmdlet when it is instantiated. + private string __correlationId = System.Guid.NewGuid().ToString(); + + /// A copy of the Invocation Info (necessary to allow asJob to clone this cmdlet) + private global::System.Management.Automation.InvocationInfo __invocationInfo; + + /// A unique id generatd for the this cmdlet when ProcessRecord() is called. + private string __processRecordId; + + /// + /// The for this operation. + /// + private global::System.Threading.CancellationTokenSource _cancellationTokenSource = new global::System.Threading.CancellationTokenSource(); + + /// Properties of the table, including Id, resource name, resource type. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable _parametersBody = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.Table(); + + /// Wait for .NET debugger to attach + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Wait for .NET debugger to attach")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter Break { get; set; } + + /// The reference to the client API class. + public Microsoft.Azure.PowerShell.Cmdlets.Storage.StorageManagementClient Client => Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.ClientAPI; + + /// + /// The credentials, account, tenant, and subscription used for communication with Azure + /// + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "The credentials, account, tenant, and subscription used for communication with Azure.")] + [global::System.Management.Automation.ValidateNotNull] + [global::System.Management.Automation.Alias("AzureRMContext", "AzureCredential")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Azure)] + public global::System.Management.Automation.PSObject DefaultProfile { get; set; } + + /// SendAsync Pipeline Steps to be appended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be appended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelineAppend { get; set; } + + /// SendAsync Pipeline Steps to be prepended to the front of the pipeline + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "SendAsync Pipeline Steps to be prepended to the front of the pipeline")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[] HttpPipelinePrepend { get; set; } + + /// Backing field for property. + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity _inputObject; + + /// Identity Parameter + [global::System.Management.Automation.Parameter(Mandatory = true, HelpMessage = "Identity Parameter", ValueFromPipeline = true)] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Path)] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.IStorageIdentity InputObject { get => this._inputObject; set => this._inputObject = value; } + + /// Accessor for our copy of the InvocationInfo. + public global::System.Management.Automation.InvocationInfo InvocationInformation { get => __invocationInfo = __invocationInfo ?? this.MyInvocation ; set { __invocationInfo = value; } } + + /// + /// cancellation delegate. Stops the cmdlet when called. + /// + global::System.Action Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Cancel => _cancellationTokenSource.Cancel; + + /// cancellation token. + global::System.Threading.CancellationToken Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Token => _cancellationTokenSource.Token; + + /// + /// The instance of the that the remote call will use. + /// + private Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.HttpPipeline Pipeline { get; set; } + + /// The URI for the proxy server to use + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "The URI for the proxy server to use")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Uri Proxy { get; set; } + + /// Credentials for a proxy server to use for the remote call + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Credentials for a proxy server to use for the remote call")] + [global::System.Management.Automation.ValidateNotNull] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.PSCredential ProxyCredential { get; set; } + + /// Use the default credentials for the proxy + [global::System.Management.Automation.Parameter(Mandatory = false, DontShow = true, HelpMessage = "Use the default credentials for the proxy")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Runtime)] + public global::System.Management.Automation.SwitchParameter ProxyUseDefaultCredentials { get; set; } + + /// List of stored access policies specified on the table. + [global::System.Management.Automation.AllowEmptyCollection] + [global::System.Management.Automation.Parameter(Mandatory = false, HelpMessage = "List of stored access policies specified on the table.")] + [global::Microsoft.Azure.PowerShell.Cmdlets.Storage.Category(global::Microsoft.Azure.PowerShell.Cmdlets.Storage.ParameterCategory.Body)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Info( + Required = false, + ReadOnly = false, + Description = @"List of stored access policies specified on the table.", + SerializedName = @"signedIdentifiers", + PossibleTypes = new [] { typeof(Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier) })] + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITableSignedIdentifier[] TablePropertySignedIdentifier { get => _parametersBody.PropertySignedIdentifier ?? null /* arrayOf */; set => _parametersBody.PropertySignedIdentifier = value; } + + /// + /// overrideOnDefault will be called before the regular onDefault has been processed, allowing customization of what + /// happens on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// /// Determines if the rest of the onDefault method should be processed, or if the method should + /// return immediately (set to true to skip further processing ) + + partial void overrideOnDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// overrideOnOk will be called before the regular onOk has been processed, allowing customization of what happens + /// on that response. Implement this method in a partial class to enable this behavior + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// /// Determines if the rest of the onOk method should be processed, or if the method should return + /// immediately (set to true to skip further processing ) + + partial void overrideOnOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response, ref global::System.Threading.Tasks.Task returnNow); + + /// + /// (overrides the default BeginProcessing method in global::System.Management.Automation.PSCmdlet) + /// + protected override void BeginProcessing() + { + var telemetryId = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.GetTelemetryId.Invoke(); + if (telemetryId != "" && telemetryId != "internal") + { + __correlationId = telemetryId; + } + Module.Instance.SetProxyConfiguration(Proxy, ProxyCredential, ProxyUseDefaultCredentials); + if (Break) + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.AttachDebugger.Break(); + } + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeginProcessing).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + + /// Performs clean-up after the command execution + protected override void EndProcessing() + { + + } + + /// Handles/Dispatches events during the call to the REST service. + /// The message id + /// The message cancellation token. When this call is cancelled, this should be true + /// Detailed message data for the message event. + /// + /// A that will be complete when handling of the message is completed. + /// + async global::System.Threading.Tasks.Task Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener.Signal(string id, global::System.Threading.CancellationToken token, global::System.Func messageData) + { + using( NoSynchronizationContext ) + { + if (token.IsCancellationRequested) + { + return ; + } + + switch ( id ) + { + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Verbose: + { + WriteVerbose($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Warning: + { + WriteWarning($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Information: + { + var data = messageData(); + WriteInformation(data.Message, new string[]{}); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Debug: + { + WriteDebug($"{(messageData().Message ?? global::System.String.Empty)}"); + return ; + } + case Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.Error: + { + WriteError(new global::System.Management.Automation.ErrorRecord( new global::System.Exception(messageData().Message), string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null ) ); + return ; + } + } + await Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.Signal(id, token, messageData, (i,t,m) => ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(i,t,()=> Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventDataConverter.ConvertFrom( m() ) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.EventData ), InvocationInformation, this.ParameterSetName, __correlationId, __processRecordId, null ); + if (token.IsCancellationRequested) + { + return ; + } + WriteDebug($"{id}: {(messageData().Message ?? global::System.String.Empty)}"); + } + } + + /// Performs execution of the command. + protected override void ProcessRecord() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordStart).Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + __processRecordId = System.Guid.NewGuid().ToString(); + try + { + // work + if (ShouldProcess($"Call remote 'TableUpdate' operation")) + { + using( var asyncCommandRuntime = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.AsyncCommandRuntime(this, ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token) ) + { + asyncCommandRuntime.Wait( ProcessRecordAsync(),((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token); + } + } + } + catch (global::System.AggregateException aggregateException) + { + // unroll the inner exceptions to get the root cause + foreach( var innerException in aggregateException.Flatten().InnerExceptions ) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{innerException.GetType().Name} - {innerException.Message} : {innerException.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(innerException,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + } + catch (global::System.Exception exception) when ((exception as System.Management.Automation.PipelineStoppedException)== null || (exception as System.Management.Automation.PipelineStoppedException).InnerException != null) + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletException, $"{exception.GetType().Name} - {exception.Message} : {exception.StackTrace}").Wait(); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + // Write exception out to error channel. + WriteError( new global::System.Management.Automation.ErrorRecord(exception,string.Empty, global::System.Management.Automation.ErrorCategory.NotSpecified, null) ); + } + finally + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordEnd).Wait(); + } + } + + /// Performs execution of the command, working asynchronously if required. + /// + /// A that will be complete when handling of the method is completed. + /// + protected async global::System.Threading.Tasks.Task ProcessRecordAsync() + { + using( NoSynchronizationContext ) + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletGetPipeline); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + Pipeline = Microsoft.Azure.PowerShell.Cmdlets.Storage.Module.Instance.CreatePipeline(InvocationInformation, __correlationId, __processRecordId, this.ParameterSetName); + if (null != HttpPipelinePrepend) + { + Pipeline.Prepend((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelinePrepend) ?? HttpPipelinePrepend); + } + if (null != HttpPipelineAppend) + { + Pipeline.Append((this.CommandRuntime as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.IAsyncCommandRuntimeExtensions)?.Wrap(HttpPipelineAppend) ?? HttpPipelineAppend); + } + // get the client instance + try + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletBeforeAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + if (InputObject?.Id != null) + { + await this.Client.TableUpdateViaIdentity(InputObject.Id, _parametersBody, onOk, onDefault, this, Pipeline); + } + else + { + // try to call with PATH parameters from Input Object + if (null == InputObject.ResourceGroupName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.ResourceGroupName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.AccountName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.AccountName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.SubscriptionId) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.SubscriptionId"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + if (null == InputObject.TableName) + { + ThrowTerminatingError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception("InputObject has null value for InputObject.TableName"),string.Empty, global::System.Management.Automation.ErrorCategory.InvalidArgument, InputObject) ); + } + await this.Client.TableUpdate(InputObject.ResourceGroupName ?? null, InputObject.AccountName ?? null, InputObject.SubscriptionId ?? null, InputObject.TableName ?? null, _parametersBody, onOk, onDefault, this, Pipeline); + } + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletAfterAPICall); if( ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Token.IsCancellationRequested ) { return; } + } + catch (Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.UndeclaredResponseException urexception) + { + WriteError(new global::System.Management.Automation.ErrorRecord(urexception, urexception.StatusCode.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody}) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(urexception.Message) { RecommendedAction = urexception.Action } + }); + } + finally + { + await ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.CmdletProcessRecordAsyncEnd); + } + } + } + + /// Interrupts currently running code within the command. + protected override void StopProcessing() + { + ((Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener)this).Cancel(); + base.StopProcessing(); + } + + /// + /// Intializes a new instance of the cmdlet class. + /// + public UpdateAzStorageTable_UpdateViaIdentityExpanded() + { + + } + + /// + /// a delegate that is called when the remote service returns default (any response code not handled elsewhere). + /// + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ICloudError + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onDefault(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnDefault(responseMessage, response, ref _returnNow); + // if overrideOnDefault has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // Error Response : default + var code = (await response)?.Code; + var message = (await response)?.Message; + if ((null == code || null == message)) + { + // Unrecognized Response. Create an error record based on what we have. + var ex = new Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.RestException(responseMessage, await response); + WriteError( new global::System.Management.Automation.ErrorRecord(ex, ex.Code, global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(ex.Message) { RecommendedAction = ex.Action } + }); + } + else + { + WriteError( new global::System.Management.Automation.ErrorRecord(new global::System.Exception($"[{code}] : {message}"), code?.ToString(), global::System.Management.Automation.ErrorCategory.InvalidOperation, new { body=_parametersBody }) + { + ErrorDetails = new global::System.Management.Automation.ErrorDetails(message) { RecommendedAction = global::System.String.Empty } + }); + } + } + } + + /// a delegate that is called when the remote service returns 200 (OK). + /// the raw response message as an global::System.Net.Http.HttpResponseMessage. + /// the body result as a Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + /// from the remote call + /// + /// A that will be complete when handling of the method is completed. + /// + private async global::System.Threading.Tasks.Task onOk(global::System.Net.Http.HttpResponseMessage responseMessage, global::System.Threading.Tasks.Task response) + { + using( NoSynchronizationContext ) + { + var _returnNow = global::System.Threading.Tasks.Task.FromResult(false); + overrideOnOk(responseMessage, response, ref _returnNow); + // if overrideOnOk has returned true, then return right away. + if ((null != _returnNow && await _returnNow)) + { + return ; + } + // onOk - response for 200 / application/json + // (await response) // should be Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.ITable + WriteObject((await response)); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml new file mode 100644 index 000000000000..ae0c12dd4efa --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.format.ps1xml @@ -0,0 +1,496 @@ + + + + + AzureErrorRecords + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + AzureErrorRecords + + + $_.InvocationInfo.HistoryId + + + + + + + + ErrorCategory + + + ErrorDetail + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.BoundParameters + + + + $_.InvocationInfo.UnboundParameters + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord] + + + + + RequestId + + + Message + + + ServerMessage + + + ServerResponse + + + RequestMessage + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + StackTrace + + + + $_.InvocationInfo.HistoryId + + + + + + + AzureErrorRecords + $_.GetType() -eq [Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord] + + + + + Message + + + StackTrace + + + + $_.Exception.GetType() + + + + "{" + $_.InvocationInfo.MyCommand + "}" + + + + $_.InvocationInfo.Line + + + + $_.InvocationInfo.PositionMessage + + + + $_.InvocationInfo.HistoryId + + + + + + + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + Microsoft.Azure.Commands.Profile.CommonModule.PSAzureServiceProfile + + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Description + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + Token + + + ExpiresOn + + + Type + + + TenantId + + + UserId + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscriptionPolicy + + + + + Left + + + + Left + + + + Left + + + + + + + + Left + locationPlacementId + + + Left + QuotaId + + + Left + SpendingLimit + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + Id + + + Type + + + Tenants + + + Credential + + + TenantMap + + + CertificateThumbprint + + + + $_.ExtendedProperties.GetEnumerator() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml new file mode 100644 index 000000000000..a81dae94b4db --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.generated.format.ps1xml @@ -0,0 +1,468 @@ + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + ResourceManagerUrl + + + Left + ActiveDirectoryAuthority + + + Left + Type + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Id + + + Left + TenantId + + + Left + State + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + $_.Context.Account.ToString() + + + Left + $_.Context.Subscription.Name + + + Left + $_.Context.Tenant.ToString() + + + Left + $_.Context.Environment.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + 40 + Left + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Name + + + Left + Account + + + Left + $_.Subscription.Name + + + Left + Environment + + + Left + $_.Tenant.ToString() + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + Left + + + + Left + + + + Left + + + + Left + + + + + + + + Left + Id + + + Left + $_.Name + + + Left + $_.TenantCategory + + + Left + $_.Domains + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml new file mode 100644 index 000000000000..e3b670a7daff --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Accounts.types.ps1xml @@ -0,0 +1,303 @@ + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.AuthenticationStoreTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Core.ProtectedFileTokenCache + + + PSStandardMembers + + + SerializationMethod + SpecificProperties + + + PropertySerializationSet + + CacheData + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + PSStandardMembers + + + SerializationDepth + 10 + + + + + + Microsoft.Azure.Commands.Profile.Models.AzureContextConverter + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec new file mode 100644 index 000000000000..f664d888f3b8 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.nuspec @@ -0,0 +1,20 @@ + + + + Az.Accounts + 2.7.5 + Microsoft Corporation + Microsoft Corporation + true + https://aka.ms/azps-license + https://github.com/Azure/azure-powershell + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + * Added 'SshCredentialFactory' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment + Microsoft Corporation. All rights reserved. + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + + \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 new file mode 100644 index 000000000000..5597a247fce7 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psd1 @@ -0,0 +1,387 @@ +# +# Module manifest for module 'Az.Accounts' +# +# Generated by: Microsoft Corporation +# +# Generated on: 3/31/2022 +# + +@{ + +# Script module or binary module file associated with this manifest. +RootModule = 'Az.Accounts.psm1' + +# Version number of this module. +ModuleVersion = '2.7.5' + +# Supported PSEditions +CompatiblePSEditions = 'Core', 'Desktop' + +# ID used to uniquely identify this module +GUID = '17a2feff-488b-47f9-8729-e2cec094624c' + +# Author of this module +Author = 'Microsoft Corporation' + +# Company or vendor of this module +CompanyName = 'Microsoft Corporation' + +# Copyright statement for this module +Copyright = 'Microsoft Corporation. All rights reserved.' + +# Description of the functionality provided by this module +Description = 'Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps' + +# Minimum version of the PowerShell engine required by this module +PowerShellVersion = '5.1' + +# Name of the PowerShell host required by this module +# PowerShellHostName = '' + +# Minimum version of the PowerShell host required by this module +# PowerShellHostVersion = '' + +# Minimum version of Microsoft .NET Framework required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +DotNetFrameworkVersion = '4.7.2' + +# Minimum version of the common language runtime (CLR) required by this module. This prerequisite is valid for the PowerShell Desktop edition only. +# ClrVersion = '' + +# Processor architecture (None, X86, Amd64) required by this module +# ProcessorArchitecture = '' + +# Modules that must be imported into the global environment prior to importing this module +# RequiredModules = @() + +# Assemblies that must be loaded prior to importing this module +RequiredAssemblies = 'Microsoft.Azure.PowerShell.Authentication.Abstractions.dll', + 'Microsoft.Azure.PowerShell.Authentication.dll', + 'Microsoft.Azure.PowerShell.Authenticators.dll', + 'Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Clients.Authorization.dll', + 'Microsoft.Azure.PowerShell.Clients.Compute.dll', + 'Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll', + 'Microsoft.Azure.PowerShell.Clients.Monitor.dll', + 'Microsoft.Azure.PowerShell.Clients.Network.dll', + 'Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll', + 'Microsoft.Azure.PowerShell.Clients.ResourceManager.dll', + 'Microsoft.Azure.PowerShell.Common.dll', + 'Microsoft.Azure.PowerShell.Storage.dll', + 'Microsoft.Azure.PowerShell.Clients.Storage.Management.dll', + 'Microsoft.Azure.PowerShell.Clients.KeyVault.dll', + 'Microsoft.Azure.PowerShell.Clients.Websites.dll', + 'Hyak.Common.dll', 'Microsoft.ApplicationInsights.dll', + 'Microsoft.Azure.Common.dll', 'Microsoft.Rest.ClientRuntime.dll', + 'Microsoft.Rest.ClientRuntime.Azure.dll', + 'Microsoft.WindowsAzure.Storage.dll', + 'Microsoft.WindowsAzure.Storage.DataMovement.dll', + 'Microsoft.Azure.PowerShell.Clients.Aks.dll', + 'Microsoft.Azure.PowerShell.Strategies.dll', + 'Microsoft.Azure.PowerShell.Common.Share.dll' + +# Script files (.ps1) that are run in the caller's environment prior to importing this module. +# ScriptsToProcess = @() + +# Type files (.ps1xml) to be loaded when importing this module +# TypesToProcess = @() + +# Format files (.ps1xml) to be loaded when importing this module +FormatsToProcess = 'Accounts.format.ps1xml', 'Accounts.generated.format.ps1xml' + +# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess +NestedModules = @() + +# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no functions to export. +FunctionsToExport = @() + +# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export. +CmdletsToExport = 'Disable-AzDataCollection', 'Disable-AzContextAutosave', + 'Enable-AzDataCollection', 'Enable-AzContextAutosave', + 'Remove-AzEnvironment', 'Get-AzEnvironment', 'Set-AzEnvironment', + 'Add-AzEnvironment', 'Get-AzSubscription', 'Connect-AzAccount', + 'Get-AzContext', 'Set-AzContext', 'Import-AzContext', 'Save-AzContext', + 'Get-AzTenant', 'Send-Feedback', 'Resolve-AzError', 'Select-AzContext', + 'Rename-AzContext', 'Remove-AzContext', 'Clear-AzContext', + 'Disconnect-AzAccount', 'Get-AzContextAutosaveSetting', + 'Set-AzDefault', 'Get-AzDefault', 'Clear-AzDefault', + 'Register-AzModule', 'Enable-AzureRmAlias', 'Disable-AzureRmAlias', + 'Uninstall-AzureRm', 'Invoke-AzRestMethod', 'Get-AzAccessToken', + 'Open-AzSurveyLink' + +# Variables to export from this module +# VariablesToExport = @() + +# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no aliases to export. +AliasesToExport = 'Add-AzAccount', 'Login-AzAccount', 'Remove-AzAccount', + 'Logout-AzAccount', 'Select-AzSubscription', 'Resolve-Error', + 'Save-AzProfile', 'Get-AzDomain', 'Invoke-AzRest' + +# DSC resources to export from this module +# DscResourcesToExport = @() + +# List of all modules packaged with this module +# ModuleList = @() + +# List of all files packaged with this module +# FileList = @() + +# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell. +PrivateData = @{ + + PSData = @{ + + # Tags applied to this module. These help with module discovery in online galleries. + Tags = 'Azure','ResourceManager','ARM','Accounts','Authentication','Environment','Subscription' + + # A URL to the license for this module. + LicenseUri = 'https://aka.ms/azps-license' + + # A URL to the main website for this project. + ProjectUri = 'https://github.com/Azure/azure-powershell' + + # A URL to an icon representing this module. + # IconUri = '' + + # ReleaseNotes of this module + ReleaseNotes = '* Added ''SshCredentialFactory'' to support get ssh credential of vm from msal. +* Fixed the bug of cmdlet fails when -DefaultProfile is set to service principal login context. [#16617] +* Fixed the issue that authorization does not work in Dogfood environment' + + # Prerelease string of this module + # Prerelease = '' + + # Flag to indicate whether the module requires explicit user acceptance for install/update/save + # RequireLicenseAcceptance = $false + + # External dependent modules of this module + # ExternalModuleDependencies = @() + + } # End of PSData hashtable + + } # End of PrivateData hashtable + +# HelpInfo URI of this module +# HelpInfoURI = '' + +# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix. +# DefaultCommandPrefix = '' + +} + + +# SIG # Begin signature block +# MIInoQYJKoZIhvcNAQcCoIInkjCCJ44CAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBfih7Yjug0H4t7 +# yWl+P37e8ytBZAxLWrUP62/jyADYPKCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZdjCCGXICAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgXA6GKgxI +# VhLOuEe05JK0ofRRaS3Iixk8S4yAEDyheGcwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCk7+MONSYp7vxlpfSvtfVGPGdZ5LuxWlb4eimh/TgO +# qAAMDghpYUB8mFe46dAf/OoVHrcxhCfAof+aWlMkEqZTwIZ6p0XsXZ72jDLDFLgf +# WJNQ605jndPQx7/b3tDvqqI1sCHz4CvYnqiQn4/JpHjiE4321HRDFjhWv1lhTpMx +# Xaifyrvwc1OwLcSqMrEPSShevbYOH54J0MG+qI+t+AQ9D/WQdL/5HBJZ8PDZ2n9b +# I4FxGwm0aeTSnAiV602r8db+jebwv/5ypKfkok4IzN9qdQY1y3jXdP9MfEK2nCod +# Mbuby8eakQsarqZJovnvBOsZANYE8UafuSbYMQtJaEtnoYIXADCCFvwGCisGAQQB +# gjcDAwExghbsMIIW6AYJKoZIhvcNAQcCoIIW2TCCFtUCAQMxDzANBglghkgBZQME +# AgEFADCCAVEGCyqGSIb3DQEJEAEEoIIBQASCATwwggE4AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIPieBDiQ8jeOJOjc2VK1Wl36ph7izu7GPD9rSN/j +# BxeOAgZiFm2JbrQYEzIwMjIwMzMxMTAyMDU2LjYzNlowBIACAfSggdCkgc0wgcox +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJTAjBgNVBAsTHE1p +# Y3Jvc29mdCBBbWVyaWNhIE9wZXJhdGlvbnMxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOjEyQkMtRTNBRS03NEVCMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNloIIRVzCCBwwwggT0oAMCAQICEzMAAAGhAYVVmblUXYoAAQAAAaEw +# DQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwHhcN +# MjExMjAyMTkwNTI0WhcNMjMwMjI4MTkwNTI0WjCByjELMAkGA1UEBhMCVVMxEzAR +# BgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1p +# Y3Jvc29mdCBDb3Jwb3JhdGlvbjElMCMGA1UECxMcTWljcm9zb2Z0IEFtZXJpY2Eg +# T3BlcmF0aW9uczEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046MTJCQy1FM0FFLTc0 +# RUIxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2UwggIiMA0G +# CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDayTxe5WukkrYxxVuHLYW9BEWCD9kk +# jnnHsOKwGddIPbZlLY+l5ovLDNf+BEMQKAZQI3DX91l1yCDuP9X7tOPC48ZRGXA/ +# bf9ql0FK5438gIl7cV528XeEOFwc/A+UbIUfW296Omg8Z62xaQv3jrG4U/priArF +# /er1UA1HNuIGUyqjlygiSPwK2NnFApi1JD+Uef5c47kh7pW1Kj7RnchpFeY9MekP +# QRia7cEaUYU4sqCiJVdDJpefLvPT9EdthlQx75ldx+AwZf2a9T7uQRSBh8tpxPdI +# DDkKiWMwjKTrAY09A3I/jidqPuc8PvX+sqxqyZEN2h4GA0Edjmk64nkIukAK18K5 +# nALDLO9SMTxpAwQIHRDtZeTClvAPCEoy1vtPD7f+eqHqStuu+XCkfRjXEpX9+h9f +# rsB0/BgD5CBf3ELLAa8TefMfHZWEJRTPNrbXMKizSrUSkVv/3HP/ZsJpwaz5My2R +# byc3Ah9bT76eBJkyfT5FN9v/KQ0HnxhRMs6HHhTmNx+LztYci+vHf0D3QH1eCjZW +# ZRjp1mOyxpPU2mDMG6gelvJse1JzRADo7YIok/J3Ccbm8MbBbm85iogFltFHecHF +# EFwrsDGBFnNYHMhcbarQNA+gY2e2l9fAkX3MjI7Uklkoz74/P6KIqe5jcd9FPCbb +# SbYH9OLsteeYOQIDAQABo4IBNjCCATIwHQYDVR0OBBYEFBa/IDLbY475VQyKiZSw +# 47l0/cypMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMF8GA1UdHwRY +# MFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01p +# Y3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEwKDEpLmNybDBsBggrBgEF +# BQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9w +# a2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAo +# MSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYIKwYBBQUHAwgwDQYJKoZI +# hvcNAQELBQADggIBACDDIxElfXlG5YKcKrLPSS+f3JWZprwKEiASvivaHTBRlXtA +# s+TkadcsEei+9w5vmF5tCUzTH4c0nCI7bZxnsL+S6XsiOs3Z1V4WX+IwoXUJ4zLv +# s0+mT4vjGDtYfKQ/bsmJKar2c99m/fHv1Wm2CTcyaePvi86Jh3UyLjdRILWbtzs4 +# oImFMwwKbzHdPopxrBhgi+C1YZshosWLlgzyuxjUl+qNg1m52MJmf11loI7D9HJo +# aQzd+rf928Y8rvULmg2h/G50o+D0UJ1Fa/cJJaHfB3sfKw9X6GrtXYGjmM3+g+Ah +# aVsfupKXNtOFu5tnLKvAH5OIjEDYV1YKmlXuBuhbYassygPFMmNgG2Ank3drEcDc +# ZhCXXqpRszNo1F6Gu5JCpQZXbOJM9Ue5PlJKtmImAYIGsw+pnHy/r5ggSYOp4g5Z +# 1oU9GhVCM3V0T9adee6OUXBk1rE4dZc/UsPlj0qoiljL+lN1A5gkmmz7k5tIObVG +# B7dJdz8J0FwXRE5qYu1AdvauVbZwGQkL1x8aK/svjEQW0NUyJ29znDHiXl5vLoRT +# jjFpshUBi2+IY+mNqbLmj24j5eT+bjDlE3HmNtLPpLcMDYqZ1H+6U6YmaiNmac2j +# RXDAaeEE/uoDMt2dArfJP7M+MDv3zzNNTINeuNEtDVgm9zwfgIUCXnDZuVtiMIIH +# cTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTANBgkqhkiG9w0BAQsFADCB +# iDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1Jl +# ZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEyMDAGA1UEAxMp +# TWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTAwHhcNMjEw +# OTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYDVQQGEwJVUzETMBEGA1UE +# CBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9z +# b2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQ +# Q0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAOThpkzntHIh +# C3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDivbk+F2Az/1xPx2b3lVNx +# WuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5GawcU88V29YZQ3MFEyHFc +# UTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUmZNqYO7oaezOtgFt+jBAc +# nVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjksUZzpcGkNyjYtcI4xyDUo +# veO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvrg0XnRm7KMtXAhjBcTyzi +# YrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31BmkZ1zcRfNN0Sidb9pSB9 +# fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PRc6ZNN3SUHDSCD/AQ8rdH +# GO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRRRuLRvWoYWmEBc8pnol7X +# KHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSRlJTYuVD5C4lh8zYGNRiE +# R9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflSxIUXk8A8FdsaN8cIFRg/ +# eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHdMIIB2TASBgkrBgEEAYI3 +# FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSavoKRPEY1Kc8Q/y8E7jAd +# BgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYDVR0gBFUwUzBRBgwrBgEE +# AYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1UdJQQMMAoGCCsGAQUFBwMI +# MBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1UdDwQEAwIBhjAPBgNVHRMB +# Af8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjRPZSQW9fOmhjEMFYGA1Ud +# HwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0LmNvbS9wa2kvY3JsL3By +# b2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNybDBaBggrBgEFBQcBAQRO +# MEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbS9wa2kvY2Vy +# dHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0GCSqGSIb3DQEBCwUAA4IC +# AQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHixBpOXPTEztTnXwnE2P9pk +# bHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjYNi6cqYJWAAOwBb6J6Gng +# ugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe53Z/zjj3G82jfZfakVqr3 +# lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BUhUKz/AyeixmJ5/ALaoHC +# gRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QMvOyRgNI95ko+ZjtPu4b6 +# MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1APMdUbZ1jdEgssU5HLcEU +# BHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsNn6Qo3GcZKCS6OEuabvsh +# VGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFsc/4Ku+xBZj1p/cvBQUl+ +# fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue10CgaiQuPNtq6TPmb/wrp +# NPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6gMTN9vMvpe784cETRkPHI +# qzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm8qGCAs4wggI3AgEBMIH4 +# oYHQpIHNMIHKMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSUw +# IwYDVQQLExxNaWNyb3NvZnQgQW1lcmljYSBPcGVyYXRpb25zMSYwJAYDVQQLEx1U +# aGFsZXMgVFNTIEVTTjoxMkJDLUUzQUUtNzRFQjElMCMGA1UEAxMcTWljcm9zb2Z0 +# IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUAG3F2jO4LEMVLwgKG +# XdYMN4FBgOCggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGlu +# Z3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBv +# cmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDAN +# BgkqhkiG9w0BAQUFAAIFAOXvuD8wIhgPMjAyMjAzMzExMzE4NTVaGA8yMDIyMDQw +# MTEzMTg1NVowdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e+4PwIBADAKAgEAAgIP +# IwIB/zAHAgEAAgIRnzAKAgUA5fEJvwIBADA2BgorBgEEAYRZCgQCMSgwJjAMBgor +# BgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0GCSqGSIb3DQEBBQUA +# A4GBANc53MLryLt1FD+jkakQydkemUps4QiN8HJxJ36VPuc2XRhvcn0Fhp1Pi8Hk +# gg08sFJoJ2vT/9g5J39zdjQpnbNGMkfmEi+qT6hbGq0ta5rnt1wDG2pVMuMn7N2Q +# 8CytKi6ZynWVbiCNuQtxsuwdgM7bRwcf510Wwp7iQUeNjJZzMYIEDTCCBAkCAQEw +# gZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcT +# B1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UE +# AxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMAAAGhAYVVmblUXYoA +# AQAAAaEwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJAzENBgsqhkiG9w0B +# CRABBDAvBgkqhkiG9w0BCQQxIgQg7aLPwq2FhUC9oleuUeRc4uk9d+4UFLvls0ps +# 5tQU14wwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCDrCFTxOoGCaCCCjoRy +# Be1JSQrMJeCCTyErziiJ347QhDCBmDCBgKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABoQGFVZm5VF2KAAEAAAGhMCIEIOKn52EgS+EFhqx/FxY8 +# xYD6qqUYqtVZ3iZ47g3sjJRaMA0GCSqGSIb3DQEBCwUABIICACJi4QGIi9yhn8uf +# NlWbdGQNP0UkTWxJRMnAe4eQUYbcHoOxPxguwy7r8VfTZOdKBxfy7/LKo5XGmAo2 +# hmZSsLHjtT0zzkZti2AFeCRmZ8DMVaGfR9sWBr0OwlRS3HMDigpWyI5jP/tD529k +# jh0/BYwKg2TGRk6ZmdFWXuQf0lVb/LytEUyFbziq4hoxhKc4IQ3oCcOm1xaVZzbe +# SgzPg3j4QfHAucYgfxJoIUP1lKTRclmUc2ERYmHchaUxeYIdiDHx5lpEdNsh0acm +# LgV307ncxLeN1Ih2E6By+Dknm8OppqVYOSvcjcjqHY+fU7ci/FuvyUVDQv6xe2ZS +# K6qCMCrPWtoOlE3ms+LE5kHVQ1JOs0v7mVVP8xfO+fkArk3RuUl/1gaGxi5Ljheg +# l+51jV5PMM4Vha9KoWfU2306ZLt/I1Rftq1sCOD5ysLnhTQuInQMRpfXlY/rvTPu +# 9jzQ4q4Ty7WPp004gh+9hLIm0s0nmZmM8jyTRUFrK1SfHglBOKgdrcuJfmEuPKxL +# foRg/LzuUjcXvdtO3oozIaVWsTxGx6laY2DkMPnqYaj/oBwla86bNyQT94YTTGWq +# 3mCwt0/H4E3Mn1OXLVIGO3NrzZwTFFN2uqRmcTQ0AKiXU3ar4b8F/ykpQOvTV6x/ +# U7Jz/JaISbEvO3mUarzheUPqVmWq +# SIG # End signature block diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 new file mode 100644 index 000000000000..67107181add7 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Az.Accounts.psm1 @@ -0,0 +1,375 @@ +# +# Script module for module 'Az.Accounts' that is executed when 'Az.Accounts' is imported in a PowerShell session. +# +# Generated by: Microsoft Corporation +# +# Generated on: 03/31/2022 09:26:49 +# + +$PSDefaultParameterValues.Clear() +Set-StrictMode -Version Latest + +function Test-DotNet +{ + try + { + if ((Get-PSDrive 'HKLM' -ErrorAction Ignore) -and (-not (Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\' -ErrorAction Stop | Get-ItemPropertyValue -ErrorAction Stop -Name Release | Where-Object { $_ -ge 461808 }))) + { + throw ".NET Framework versions lower than 4.7.2 are not supported in Az. Please upgrade to .NET Framework 4.7.2 or higher." + } + } + catch [System.Management.Automation.DriveNotFoundException] + { + Write-Verbose ".NET Framework version check failed." + } +} + +function Preload-Assembly { + param ( + [string] + $AssemblyDirectory + ) + if($PSEdition -eq 'Desktop' -and (Test-Path $AssemblyDirectory -ErrorAction Ignore)) + { + try + { + Get-ChildItem -ErrorAction Stop -Path $AssemblyDirectory -Filter "*.dll" | ForEach-Object { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + catch {} + } +} + +if ($true -and ($PSEdition -eq 'Desktop')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'5.1') + { + throw "PowerShell versions lower than 5.1 are not supported in Az. Please upgrade to PowerShell 5.1 or higher." + } + + Test-DotNet +} + +if ($true -and ($PSEdition -eq 'Core')) +{ + if ($PSVersionTable.PSVersion -lt [Version]'6.2.4') + { + throw "Current Az version doesn't support PowerShell Core versions lower than 6.2.4. Please upgrade to PowerShell Core 6.2.4 or higher." + } + if ($PSVersionTable.PSVersion -lt [Version]'7.0.6') + { + Write-Warning "This version of Az.Accounts is only supported on Windows PowerShell 5.1 and PowerShell 7.0.6 or greater, open https://aka.ms/install-powershell to learn how to upgrade. For further information, go to https://aka.ms/azpslifecycle." + } +} + +if (Test-Path -Path "$PSScriptRoot\StartupScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\StartupScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "PreloadAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath +$preloadPath = (Join-Path $PSScriptRoot -ChildPath "ModuleAlcAssemblies") +Preload-Assembly -AssemblyDirectory $preloadPath + +$netCorePath = (Join-Path $PSScriptRoot -ChildPath "NetCoreAssemblies") +if($PSEdition -eq 'Core' -and (Test-Path $netCorePath -ErrorAction Ignore)) +{ + try + { + $loadedAssemblies = ([System.AppDomain]::CurrentDomain.GetAssemblies() | ForEach-Object {New-Object -TypeName System.Reflection.AssemblyName -ArgumentList $_.FullName} ) + Get-ChildItem -ErrorAction Stop -Path $netCorePath -Filter "*.dll" | ForEach-Object { + $assemblyName = ([System.Reflection.AssemblyName]::GetAssemblyName($_.FullName)) + $matches = ($loadedAssemblies | Where-Object {$_.Name -eq $assemblyName.Name}) + if (-not $matches) + { + try + { + Add-Type -Path $_.FullName -ErrorAction Ignore | Out-Null + } + catch { + Write-Verbose $_ + } + } + } + } + catch {} +} + + +Import-Module (Join-Path -Path $PSScriptRoot -ChildPath Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll) + + +if (Test-Path -Path "$PSScriptRoot\PostImportScripts" -ErrorAction Ignore) +{ + Get-ChildItem "$PSScriptRoot\PostImportScripts" -ErrorAction Stop | ForEach-Object { + . $_.FullName + } +} + +$FilteredCommands = @() + +if ($Env:ACC_CLOUD -eq $null) +{ + $FilteredCommands | ForEach-Object { + + $existingDefault = $false + foreach ($key in $global:PSDefaultParameterValues.Keys) + { + if ($_ -like "$key") + { + $existingDefault = $true + } + } + + if (!$existingDefault) + { + $global:PSDefaultParameterValues.Add($_, + { + if ((Get-Command Get-AzContext -ErrorAction Ignore) -eq $null) + { + $context = Get-AzureRmContext + } + else + { + $context = Get-AzContext + } + if (($context -ne $null) -and $context.ExtendedProperties.ContainsKey("Default Resource Group")) { + $context.ExtendedProperties["Default Resource Group"] + } + }) + } + } +} + +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBnXoRblwqGgp4a +# USzJaf5Wf+Tu+eUWmfecChJ7ENNasaCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgqwm8h/dw +# FED0y+xGCWSaD8Fc1mZMgPkryh2zfSvZwxIwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBvXNrKAkE7o84rJI6+XFvnA65dqlWCZBeFhG6YGpde +# Nom1mPdcfauabmxLKg7N5GG1FBWXuYDu1aEyDhiXzPG6ET+/ikXTGfN9J0D9g5Wx +# a2SeSIJ0XfsllBKKwOKl4OhoY3y5Kjjk08Cw75aE5BR8Ux0FWciN8n+nztakOyN9 +# tf7I5nmgbrHvJC5az2N9aR5DejRvjPDcNCnRkepz3nnA+FQNFbXaKqjgJz9oRBgA +# K2SAZDQnnK3B3MAv7qJX6GyeUhen7kwXZC0OV2RjyPRC+f8SiV/OF/ZsaFe4nXps +# RJqg5f5sUjCHFS5g8yK9Zy6D7EZKJJA4yk8YgRpdxOiuoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIAn/Ph2Du7oUABZfi9Z4pWXxedNUse800UpCJBeG +# +id6AgZiF5hUHpsYEzIwMjIwMzMxMTAwMDEyLjU2OFowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046RkM0MS00QkQ0LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY5Z20YAqBCU +# zAABAAABjjANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkZDNDEtNEJENC1EMjIwMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAqiMCq6OM +# zLa5wrtcf7Bf9f1WXW9kpqbOBzgPJvaGLrZG7twgwqTRWf1FkjpJKBOG5QPIRy7a +# 6IFVAy0W+tBaFX4In4DbBf2tGubyY9+hRU+hRewPJH5CYOvpPh77FfGM63+OlwRX +# p5YER6tC0WRKn3mryWpt4CwADuGv0LD2QjnhhgtRVidsiDnn9+aLjMuNapUhstGq +# Cr7JcQZt0ZrPUHW/TqTJymeU1eqgNorEbTed6UQyLaTVAmhXNQXDChfa526nW7RQ +# 7L4tXX9Lc0oguiCSkPlu5drNA6NM8z+UXQOAHxVfIQXmi+Y3SV2hr2dcxby9nlTz +# Yvf4ZDr5Wpcwt7tTdRIJibXHsXWMKrmOziliGDToLx34a/ctZE4NOLnlrKQWN9ZG +# +Ox5zRarK1EhShahM0uQNhb6BJjp3+c0eNzMFJ2qLZqDp2/3Yl5Q+4k+MDHLTipP +# 6VBdxcdVfd4mgrVTx3afO5KNfgMngGGfhSawGraRW28EhrLOspmIxii92E7vjncJ +# 2tcjhLCjBArVpPh3cZG5g3ZVy5iiAaoDaswpNgnMFAK5Un1reK+MFhPi9iMnvUPw +# tTDDJt5YED5DAT3mBUxp5QH3t7RhZwAJNLWLtpTeGF7ub81sSKYv2ardazAe9XLS +# 10tV2oOPrcniGJzlXW7VPvxqQNxe8lCDA20CAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBTsQfkz9gT44N/5G8vNHayep+aV5DAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1UK9xzIeTlKhSbLn0bekR5gYh +# 6bB1XQpluCqCA15skZ37UilaFJw8+GklDLzlNhSP2mOiOzVyCq8kkpqnfUc01ZaB +# ezQxg77qevj2iMyg39YJfeiCIhxYOFugwepYrPO8MlB/oue/VhIiDb1eNYTlPSmv +# 3palsgtkrb0oo0F0uWmX4EQVGKRo0UENtZetVIxa0J9DpUdjQWPeEh9cEM+RgE26 +# 5w5WAVb+WNx0iWiF4iTbCmrWaVEOX92dNqBm9bT1U7nGwN5CygpNAgEaYnrTMx1N +# 4AjxObACDN5DdvGlu/O0DfMWVc6qk6iKDFC6WpXQSkMlrlXII/Nhp+0+noU6tfEp +# HKLt7fYm9of5i/QomcCwo/ekiOCjYktp393ovoC1O2uLtbLnMVlE5raBLBNSbINZ +# 6QLxiA41lXnVVLIzDihUL8MU9CMvG4sdbhk2FX8zvrsP5PeBIw1faenMZuz0V3UX +# CtU5Okx5fmioWiiLZSCi1ljaxX+BEwQiinCi+vE59bTYI5FbuR8tDuGLiVu/JSpV +# FXrzWMP2Kn11sCLAGEjqJYUmO1tRY29Kd7HcIj2niSB0PQOCjYlnCnywnDinqS1C +# XvRsisjVlS1Rp4Tmuks+pGxiMGzF58zcb+hoFKyONuL3b+tgxTAz3sF3BVX9uk9M +# 5F+OEoeyLyGfLekNAjCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046RkM0MS00QkQ0 +# LUQyMjAxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAD1iK+pPThHqgpa5xsPmiYruWVuMoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl75AOMCIY +# DzIwMjIwMzMxMTAyNzI2WhgPMjAyMjA0MDExMDI3MjZaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvkA4CAQAwCgIBAAICAYUCAf8wBwIBAAICEiowCgIFAOXw4Y4C +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQCCQ+gyinUAzBfQG0tdRLTKoWAz +# 1F9XL8HUl1+DL/nO5fnfNT2fIwdNtkcnjXkY7J89nDVJ5orczCc/Jjd8FWrGsZYF +# R7jTDpEnctly2mdeOC54DPn8NfB2rKnTAZSMNZUA5+qwXYtBJ9/L+zBcWbLJGn17 +# Xdsy6ogPG2mqiNeJETGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjlnbRgCoEJTMAAEAAAGOMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIBdm +# /Yr/algho7Se4sS1u0RA1CsQ3avLfVkP9cSuIl4vMIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgvQWPITvigaUuV5+f/lWs3BXZwJ/l1mf+yelu5nXmxCUwgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY5Z20YAqBCU +# zAABAAABjjAiBCDFYh4a5uyi794y1CHlKx3P8nxZO/8fomUMsnns7kvKmzANBgkq +# hkiG9w0BAQsFAASCAgCphAx90HI/vzWSwneRSNg3gV826YqxCNSVkzMDcu1Rkayq +# 3FhK466ELhIxyI9EL3hLCS/BIQYKH8AiVU85P07pmaLls+bUM2CPt3II0oZYY5T8 +# BN/MyqZ0vUS6QvNX8ZT8A82R5/meSt8qS8+8ppG1XumAYmdqv7vriD8ENBrhIyus +# 3Wjwt0rS2kovNj+6g3xMJBU+LnP+qzNv72aEr2LvKkU8/abYiNXN1FGlJPqHYrF/ +# zumVFsNkJMjJrlgRFlo/EROGu3iUiI37hM7mTm77aYrWoMbKrl/4nKfMpjR4KQqL +# Mhi9Cb1c11cugxCFnoc1IA6kQ+Xg1fYUchz5UmgzDTpwic3FVGGRlTv4Wf9PMjjj +# heZyL7BFkHZCpr5qpwpu/ZvpCSQpsP4Aa07qY5ffgRu/te0ip3gkzL3Ur7zNqf60 +# Dw9If1ECZOcx+GMgIHd0t+48+hsE4RrmvMvWrEBz2B/BJEOfrIQEClhFczLjDd4G +# nhh4y/vSlqbUUupH+/oJRtpla+ZQbAxsg8jTPsiGG7hmvSaNfV7+SgwCjO1HB/On +# DkzS+edyqivrfkuwjFYecbLcl9e9Pr3SPFvelW5kXiQw2KyWFrD0aznq7YT0x/Na +# /XaZDuLepRVe7YnvH4Ky7yk58zG3QYNy5EJ6Pf3ClNsX4BBAJsUrWMxicmpUDg== +# SIG # End signature block diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..32652d6de4d0 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Core.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..f2955edfecb7 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..81b736cc09da Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..f656e5e42360 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..6f2a3e0ad07f Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..fe2154a3bf3a Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/AzSharedAlcAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll new file mode 100644 index 000000000000..18a53248894f Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Hyak.Common.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll new file mode 100644 index 000000000000..92d06762d6a5 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.ApplicationInsights.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll new file mode 100644 index 000000000000..1c9d8e2a0ef5 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.Common.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll new file mode 100644 index 000000000000..8e791611cc1a Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json new file mode 100644 index 000000000000..dde9337e5748 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.deps.json @@ -0,0 +1,2309 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll new file mode 100644 index 000000000000..fcc5eb26eb20 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json new file mode 100644 index 000000000000..7828816a6777 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.deps.json @@ -0,0 +1,2273 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll new file mode 100644 index 000000000000..511cf6f6e630 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authentication.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json new file mode 100644 index 000000000000..ce563dfdebbe --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.deps.json @@ -0,0 +1,1316 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v2.1", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v2.1": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netcoreapp2.1/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.3.0", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "System.Collections/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": {}, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": {}, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netcoreapp2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": {}, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-P+MBhIM0YX+JqROuf7i306ZLJEjQYA9uUyRDE+OqwUI5sh41e2ZbPQV3LfAPh+29cmceE1pUffXsGfR4eMY3KA==", + "path": "microsoft.csharp/4.3.0", + "hashPath": "microsoft.csharp.4.3.0.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll new file mode 100644 index 000000000000..239999aa2f3c Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll new file mode 100644 index 000000000000..d966f6c302c5 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Aks.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll new file mode 100644 index 000000000000..2667669dd3f4 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Authorization.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll new file mode 100644 index 000000000000..a11687928f60 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Compute.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll new file mode 100644 index 000000000000..78fd60ad7aeb Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll new file mode 100644 index 000000000000..b33058d94c53 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.KeyVault.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll new file mode 100644 index 000000000000..e07270d24805 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Monitor.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll new file mode 100644 index 000000000000..6f489252bcac Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Network.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll new file mode 100644 index 000000000000..c19efdb8e00b Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll new file mode 100644 index 000000000000..0d443a2ecaaa Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll new file mode 100644 index 000000000000..482ccf22b352 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll new file mode 100644 index 000000000000..4bf3ee9bd78d Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Clients.Websites.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json new file mode 100644 index 000000000000..54274e52ee76 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.deps.json @@ -0,0 +1,2413 @@ +{ + "runtimeTarget": { + "name": ".NETStandard,Version=v2.0/", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETStandard,Version=v2.0": {}, + ".NETStandard,Version=v2.0/": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Authentication.ResourceManager": "1.0.0", + "Microsoft.Azure.PowerShell.Authenticators": "1.0.0", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "PowerShellStandard.Library": "5.1.0", + "System.Security.Permissions": "4.5.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll": {} + } + }, + "Azure.Core/1.22.0": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Memory.Data": "1.0.2", + "System.Numerics.Vectors": "4.5.0", + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Core.dll": { + "assemblyVersion": "1.22.0.0", + "fileVersion": "1.2200.22.6212" + } + } + }, + "Azure.Identity/1.5.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Microsoft.Identity.Client": "4.30.1", + "Microsoft.Identity.Client.Extensions.Msal": "2.18.4", + "System.Memory": "4.5.4", + "System.Security.Cryptography.ProtectedData": "4.5.0", + "System.Text.Json": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Azure.Identity.dll": { + "assemblyVersion": "1.5.0.0", + "fileVersion": "1.500.21.51401" + } + } + }, + "Hyak.Common/1.2.2": { + "dependencies": { + "NETStandard.Library": "2.0.3", + "Newtonsoft.Json": "10.0.3", + "System.Reflection": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/Hyak.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.2.2.0" + } + } + }, + "Microsoft.ApplicationInsights/2.12.0": { + "dependencies": { + "System.Diagnostics.DiagnosticSource": "4.6.0", + "System.Runtime.InteropServices": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.ApplicationInsights.dll": { + "assemblyVersion": "2.12.0.21496", + "fileVersion": "2.12.0.21496" + } + } + }, + "Microsoft.Azure.Common/2.2.1": { + "dependencies": { + "Hyak.Common": "1.2.2", + "NETStandard.Library": "2.0.3" + }, + "runtime": { + "lib/netstandard1.4/Microsoft.Azure.Common.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.2.1.0" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Authentication.Abstractions.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Aks.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Authorization.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Compute.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Graph.Rbac.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.KeyVault.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Monitor.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Network.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.PolicyInsights.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.ResourceManager.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "System.Collections.NonGeneric": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Storage.Management.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3", + "System.Collections.Specialized": "4.3.0", + "System.Reflection": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Clients.Websites.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "dependencies": { + "Hyak.Common": "1.2.2", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Common.Share.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "dependencies": { + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Storage.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Azure.PowerShell.Strategies.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "1.3.57.0" + } + } + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "dependencies": { + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Bcl.AsyncInterfaces.dll": { + "assemblyVersion": "1.0.0.0", + "fileVersion": "4.700.20.21406" + } + } + }, + "Microsoft.CSharp/4.5.0": { + "runtime": { + "lib/netstandard2.0/Microsoft.CSharp.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "Microsoft.Identity.Client/4.30.1": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Diagnostics.Process": "4.3.0", + "System.Dynamic.Runtime": "4.3.0", + "System.Private.Uri": "4.3.2", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Json": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Security.Cryptography.X509Certificates": "4.3.0", + "System.Security.SecureString": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Microsoft.Identity.Client.dll": { + "assemblyVersion": "4.30.1.0", + "fileVersion": "4.30.1.0" + } + } + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "dependencies": { + "Microsoft.Identity.Client": "4.30.1", + "System.Security.Cryptography.ProtectedData": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Identity.Client.Extensions.Msal.dll": { + "assemblyVersion": "2.18.4.0", + "fileVersion": "2.18.4.0" + } + } + }, + "Microsoft.NETCore.Platforms/1.1.1": {}, + "Microsoft.NETCore.Targets/1.1.3": {}, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "dependencies": { + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.dll": { + "assemblyVersion": "2.0.0.0", + "fileVersion": "2.3.23.0" + } + } + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "dependencies": { + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "lib/netstandard2.0/Microsoft.Rest.ClientRuntime.Azure.dll": { + "assemblyVersion": "3.0.0.0", + "fileVersion": "3.3.18.0" + } + } + }, + "Microsoft.Win32.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "Microsoft.Win32.Registry/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "NETStandard.Library/2.0.3": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1" + } + }, + "Newtonsoft.Json/10.0.3": { + "dependencies": { + "Microsoft.CSharp": "4.5.0", + "NETStandard.Library": "2.0.3", + "System.ComponentModel.TypeConverter": "4.3.0", + "System.Runtime.Serialization.Formatters": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/Newtonsoft.Json.dll": { + "assemblyVersion": "10.0.0.0", + "fileVersion": "10.0.3.21018" + } + } + }, + "PowerShellStandard.Library/5.1.0": {}, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.native.System/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Net.Http/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "dependencies": { + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple": "4.3.0" + } + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0", + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": {}, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": {}, + "System.Buffers/4.5.1": { + "runtime": { + "lib/netstandard2.0/System.Buffers.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Collections/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Collections.Concurrent/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tracing": "4.3.0", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Concurrent.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.NonGeneric/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.NonGeneric.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Collections.Specialized/4.3.0": { + "dependencies": { + "System.Collections.NonGeneric": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Extensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Collections.Specialized.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ComponentModel.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.Primitives/4.3.0": { + "dependencies": { + "System.ComponentModel": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.0/System.ComponentModel.Primitives.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.NonGeneric": "4.3.0", + "System.Collections.Specialized": "4.3.0", + "System.ComponentModel": "4.3.0", + "System.ComponentModel.Primitives": "4.3.0", + "System.Globalization": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.ComponentModel.TypeConverter.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Diagnostics.Debug/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Diagnostics.DiagnosticSource.dll": { + "assemblyVersion": "4.0.4.0", + "fileVersion": "4.700.19.46214" + } + } + }, + "System.Diagnostics.Process/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.Win32.Primitives": "4.3.0", + "Microsoft.Win32.Registry": "4.3.0", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Thread": "4.3.0", + "System.Threading.ThreadPool": "4.3.0", + "runtime.native.System": "4.3.0" + } + }, + "System.Diagnostics.Tools/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Diagnostics.Tracing/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Dynamic.Runtime/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Linq": "4.3.0", + "System.Linq.Expressions": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Dynamic.Runtime.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Globalization/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Calendars/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Globalization.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0" + } + }, + "System.IO/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading.Tasks": "4.3.0" + } + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.IO.FileSystem.Primitives.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Linq.Expressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.ObjectModel": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Linq.Expressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Memory/4.5.4": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.dll": { + "assemblyVersion": "4.0.1.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Memory.Data/1.0.2": { + "dependencies": { + "System.Text.Encodings.Web": "4.7.2", + "System.Text.Json": "4.7.2" + }, + "runtime": { + "lib/netstandard2.0/System.Memory.Data.dll": { + "assemblyVersion": "1.0.2.0", + "fileVersion": "1.0.221.20802" + } + } + }, + "System.Numerics.Vectors/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Numerics.Vectors.dll": { + "assemblyVersion": "4.1.4.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.ObjectModel/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.ObjectModel.dll": { + "assemblyVersion": "4.0.13.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.DataContractSerialization/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Emit.Lightweight": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XDocument": "4.3.0", + "System.Xml.XmlDocument": "4.3.0", + "System.Xml.XmlSerializer": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Private.DataContractSerialization.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Private.Uri/4.3.2": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Reflection/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.IO": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Emit/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.ILGeneration.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Reflection.Emit.Lightweight.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Reflection.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.Primitives/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Reflection.TypeExtensions/4.3.0": { + "dependencies": { + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.5/System.Reflection.TypeExtensions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Resources.ResourceManager/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Globalization": "4.3.0", + "System.Reflection": "4.3.0", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3" + } + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "runtime": { + "lib/netstandard2.0/System.Runtime.CompilerServices.Unsafe.dll": { + "assemblyVersion": "4.0.6.0", + "fileVersion": "4.700.20.12001" + } + } + }, + "System.Runtime.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.Handles/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Runtime.InteropServices/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Reflection": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + } + }, + "System.Runtime.Numerics/4.3.0": { + "dependencies": { + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Numerics.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Serialization.Primitives": "4.3.0" + }, + "runtime": { + "lib/netstandard1.4/System.Runtime.Serialization.Formatters.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Json/4.3.0": { + "dependencies": { + "System.IO": "4.3.0", + "System.Private.DataContractSerialization": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Json.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "dependencies": { + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Runtime.Serialization.Primitives.dll": { + "assemblyVersion": "4.1.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.AccessControl/4.5.0": { + "dependencies": { + "System.Security.Principal.Windows": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.AccessControl.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.Apple": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.Cng/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Security.Cryptography.Csp/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Collections.Concurrent": "4.3.0", + "System.Linq": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Security.Cryptography.OpenSsl.dll": { + "assemblyVersion": "4.0.0.0", + "fileVersion": "1.0.24212.1" + } + } + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "dependencies": { + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Threading": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Security.Cryptography.Primitives.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "dependencies": { + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll": { + "assemblyVersion": "4.0.3.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.Globalization.Calendars": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Runtime.Numerics": "4.3.0", + "System.Security.Cryptography.Algorithms": "4.3.0", + "System.Security.Cryptography.Cng": "4.3.0", + "System.Security.Cryptography.Csp": "4.3.0", + "System.Security.Cryptography.Encoding": "4.3.0", + "System.Security.Cryptography.OpenSsl": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "runtime.native.System": "4.3.0", + "runtime.native.System.Net.Http": "4.3.0", + "runtime.native.System.Security.Cryptography.OpenSsl": "4.3.0" + } + }, + "System.Security.Permissions/4.5.0": { + "dependencies": { + "System.Security.AccessControl": "4.5.0" + }, + "runtime": { + "lib/netstandard2.0/System.Security.Permissions.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.Principal.Windows/4.5.0": { + "runtime": { + "lib/netstandard2.0/System.Security.Principal.Windows.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.26515.6" + } + } + }, + "System.Security.SecureString/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Security.Cryptography.Primitives": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0" + } + }, + "System.Text.Encoding/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Text.Encoding.Extensions/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0", + "System.Text.Encoding": "4.3.0" + } + }, + "System.Text.Encodings.Web/4.7.2": { + "dependencies": { + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "4.0.5.1", + "fileVersion": "4.700.21.11602" + } + } + }, + "System.Text.Json/4.7.2": { + "dependencies": { + "Microsoft.Bcl.AsyncInterfaces": "1.1.1", + "System.Buffers": "4.5.1", + "System.Memory": "4.5.4", + "System.Numerics.Vectors": "4.5.0", + "System.Runtime.CompilerServices.Unsafe": "4.7.1", + "System.Text.Encodings.Web": "4.7.2", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard2.0/System.Text.Json.dll": { + "assemblyVersion": "4.0.1.2", + "fileVersion": "4.700.20.21406" + } + } + }, + "System.Text.RegularExpressions/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Threading": "4.3.0" + }, + "runtime": { + "lib/netstandard1.6/System.Text.RegularExpressions.dll": { + "assemblyVersion": "4.1.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Threading.Tasks": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.Tasks/4.3.0": { + "dependencies": { + "Microsoft.NETCore.Platforms": "1.1.1", + "Microsoft.NETCore.Targets": "1.1.3", + "System.Runtime": "4.3.0" + } + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "dependencies": { + "System.Runtime.CompilerServices.Unsafe": "4.7.1" + }, + "runtime": { + "lib/netstandard2.0/System.Threading.Tasks.Extensions.dll": { + "assemblyVersion": "4.2.0.1", + "fileVersion": "4.6.28619.1" + } + } + }, + "System.Threading.Thread/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.Thread.dll": { + "assemblyVersion": "4.0.1.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Threading.ThreadPool/4.3.0": { + "dependencies": { + "System.Runtime": "4.3.0", + "System.Runtime.Handles": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Threading.ThreadPool.dll": { + "assemblyVersion": "4.0.11.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.ReaderWriter/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.IO.FileSystem": "4.3.0", + "System.IO.FileSystem.Primitives": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Runtime.InteropServices": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Text.Encoding.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading.Tasks": "4.3.0", + "System.Threading.Tasks.Extensions": "4.5.4" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.ReaderWriter.dll": { + "assemblyVersion": "4.1.0.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Diagnostics.Tools": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Reflection": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XDocument.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlDocument/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Diagnostics.Debug": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.Encoding": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlDocument.dll": { + "assemblyVersion": "4.0.2.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "System.Xml.XmlSerializer/4.3.0": { + "dependencies": { + "System.Collections": "4.3.0", + "System.Globalization": "4.3.0", + "System.IO": "4.3.0", + "System.Linq": "4.3.0", + "System.Reflection": "4.3.0", + "System.Reflection.Emit": "4.3.0", + "System.Reflection.Emit.ILGeneration": "4.3.0", + "System.Reflection.Extensions": "4.3.0", + "System.Reflection.Primitives": "4.3.0", + "System.Reflection.TypeExtensions": "4.3.0", + "System.Resources.ResourceManager": "4.3.0", + "System.Runtime": "4.3.0", + "System.Runtime.Extensions": "4.3.0", + "System.Text.RegularExpressions": "4.3.0", + "System.Threading": "4.3.0", + "System.Xml.ReaderWriter": "4.3.0", + "System.Xml.XmlDocument": "4.3.0" + }, + "runtime": { + "lib/netstandard1.3/System.Xml.XmlSerializer.dll": { + "assemblyVersion": "4.0.12.0", + "fileVersion": "4.6.24705.1" + } + } + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Azure.Identity": "1.5.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "dependencies": { + "Azure.Core": "1.22.0", + "Hyak.Common": "1.2.2", + "Microsoft.ApplicationInsights": "2.12.0", + "Microsoft.Azure.Common": "2.2.1", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0", + "Microsoft.Azure.PowerShell.Authentication.Abstractions": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Aks": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Authorization": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Compute": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.KeyVault": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Monitor": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Network": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.PolicyInsights": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.ResourceManager": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Storage.Management": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Clients.Websites": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Common.Share": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Storage": "1.3.57-preview", + "Microsoft.Azure.PowerShell.Strategies": "1.3.57-preview", + "Microsoft.Rest.ClientRuntime": "2.3.23", + "Microsoft.Rest.ClientRuntime.Azure": "3.3.19", + "Newtonsoft.Json": "10.0.3" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authentication.ResourceManager.dll": {} + } + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "dependencies": { + "Azure.Identity": "1.5.0", + "Microsoft.Azure.PowerShell.Authentication": "1.0.0" + }, + "runtime": { + "Microsoft.Azure.PowerShell.Authenticators.dll": {} + } + } + } + }, + "libraries": { + "Microsoft.Azure.PowerShell.Cmdlets.Accounts/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Azure.Core/1.22.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ze/xRCHSSDe5TIk5vBDbVrauW1EN7UIbnBvIBfMH8KSt/I9+/7yPAjTBDgNBk0IwG6WBV+BBHp4IUtS/PGAQwQ==", + "path": "azure.core/1.22.0", + "hashPath": "azure.core.1.22.0.nupkg.sha512" + }, + "Azure.Identity/1.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VfF88dqrgKXZNOS/y4XrX/jmIfP3pkY+hBUzBNpoKml1nR+QshX6XlXWyToLtWV80TDQ1CmUVCJksktDg5+j1w==", + "path": "azure.identity/1.5.0", + "hashPath": "azure.identity.1.5.0.nupkg.sha512" + }, + "Hyak.Common/1.2.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uZpnFn48nSQwHcO0/GSBZ7ExaO0sTXKv8KariXXEWLaB4Q3AeQoprYG4WpKsCT0ByW3YffETivgc5rcH5RRDvQ==", + "path": "hyak.common/1.2.2", + "hashPath": "hyak.common.1.2.2.nupkg.sha512" + }, + "Microsoft.ApplicationInsights/2.12.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4vZcVaxywAzfLm5mAc2/llaZQTzbCqu9KirxxI/t49AkZH5Qxf7JxuAMUuv2/6JEdOOkGDzpvdrrIlf6LkFGcg==", + "path": "microsoft.applicationinsights/2.12.0", + "hashPath": "microsoft.applicationinsights.2.12.0.nupkg.sha512" + }, + "Microsoft.Azure.Common/2.2.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-abzRooh4ACKjzAKxRB6r+SHKW3d+IrLcgtVG81D+3kQU/OMjAZS1oDp9CDalhSbmxa84u0MHM5N+AKeTtKPoiw==", + "path": "microsoft.azure.common/2.2.1", + "hashPath": "microsoft.azure.common.2.2.1.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication.Abstractions/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bKDPidNeqBpTDikPnIuoMoGd26pD2PNE41cut0ASwL5exJwLNggYO55U+f/cJkgjCUMR8i5nqnlfpGHSS1I0vw==", + "path": "microsoft.azure.powershell.authentication.abstractions/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.authentication.abstractions.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Aks/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-sUGkvOvpqlEK5zdZ7HWaou3GY5bnlNrE0LuZ137+TsNfgx2E3+0Ika3a02i/9+niDDf60xj4LaNOYDSuK5zdJA==", + "path": "microsoft.azure.powershell.clients.aks/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.aks.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Authorization/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Q760F40/qfas2Al+GQhhE4gJt768pQPxlCjqrjjkukgVsq+X/M8IqpCeBzbRTiiyerhcjJoyNxqlGuZpUhqGxw==", + "path": "microsoft.azure.powershell.clients.authorization/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.authorization.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Compute/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1fcsBdYMmEJPMPN8EAgJkaJ2WxxTKH3VcLECYdL2cfg2bgN8CKbbjSvarrXEezhyduE+LdYnL0e8Pigsnaj55Q==", + "path": "microsoft.azure.powershell.clients.compute/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.compute.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Graph.Rbac/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BIMthJ1x2vQAN3iWChnNj8BfgrXvKXn+n06E0/h2MNurMXbAOn5eiPIfE8bnj2BO99uSh1ns09yEgOTPJIvZBQ==", + "path": "microsoft.azure.powershell.clients.graph.rbac/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.graph.rbac.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.KeyVault/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MfvwM8ABj/EswmYu0Bf/8kyAO6kUv2zYSihVn384SVmypomVKUu69GN0VXKbmGaovPI8v3H41Ldp7DqbPRun5A==", + "path": "microsoft.azure.powershell.clients.keyvault/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.keyvault.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Monitor/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UyCKG5BWVjYFRtH2JNx6f4KdccaSqww2y0OE2PYgib8VhLqkoPr/BQg6vKzaGsghLIerZ/egQ7ntPPw3PCtS3w==", + "path": "microsoft.azure.powershell.clients.monitor/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.monitor.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Network/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YAAHxw+zzvkGNWAi668NSoTR+V/7vf+gRhu1oFa1O1/f2NGpz5XuqPrQyAPrri64hKqB/k3OMrM7sjlIv16dAg==", + "path": "microsoft.azure.powershell.clients.network/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.network.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.PolicyInsights/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-urRIwRVzzOwpk8HhKq/b785DiL/arnmGUHbN4HvRN6ZsBkE1PU431YwgUlofb9pfB3buLcl0XJFRPLBJ0yZJUw==", + "path": "microsoft.azure.powershell.clients.policyinsights/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.policyinsights.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.ResourceManager/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-juWnd63Z2Sp+6bvtOPOF0Gj1v2AfpxXcuyodd9+U7euBro2G7Yfo2UHmHo/uaYyQUbM3HaXJPvse7BLDKjhe6w==", + "path": "microsoft.azure.powershell.clients.resourcemanager/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.resourcemanager.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Storage.Management/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HPpTWIlN+5ALqJssL7+6BD/vYrWi3eWKQ3QpWYjCFk5c9HVLTNpP+M2dq9jbsxLsZj+5Pt6gC4FIS22Q13Uhag==", + "path": "microsoft.azure.powershell.clients.storage.management/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.storage.management.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Clients.Websites/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b5yBD9FrY02r0kdNNgZ+uU0/QsW3AtmnCE/x1mUG5j8ka/V04AYUo+sDokQBzu+vnK6Y6OrVDtyWjmnKTDHpWA==", + "path": "microsoft.azure.powershell.clients.websites/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.clients.websites.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9jZYZ9LKbx16r69y7cO9d7bDjpE0/HgeBU386Y/O6q05VRaq2wAsB2rbQ9AjxcPGHfwS0+2US/RImSSqjVABRQ==", + "path": "microsoft.azure.powershell.common/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Common.Share/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-4mJSjnwZVLQYWhP47eDzdt0yaLIf2I4pqaEIqcfAjkjdbKpnCXCnJUEFRId061yuKpq1LtfBZkHDRi68I5CJxg==", + "path": "microsoft.azure.powershell.common.share/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.common.share.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Storage/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-fObXEcuhk1JUoQ0fiCV4nK4NJWqvsfsKCzapF7SFEQ87X6AasL6m5KGT8JQSnHmc849xxxaixPTxyWaf9BBlpw==", + "path": "microsoft.azure.powershell.storage/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.storage.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Strategies/1.3.57-preview": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HwyxUwDHCmY6Zdxg2xpFC9Gqmu92Xr0cAr4ElWYwz8Z7PE9uYVkTpKMIKd7oIJJgsIANTfqEU1HKoeI3FXPLqw==", + "path": "microsoft.azure.powershell.strategies/1.3.57-preview", + "hashPath": "microsoft.azure.powershell.strategies.1.3.57-preview.nupkg.sha512" + }, + "Microsoft.Bcl.AsyncInterfaces/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yuvf07qFWFqtK3P/MRkEKLhn5r2UbSpVueRziSqj0yJQIKFwG1pq9mOayK3zE5qZCTs0CbrwL9M6R8VwqyGy2w==", + "path": "microsoft.bcl.asyncinterfaces/1.1.1", + "hashPath": "microsoft.bcl.asyncinterfaces.1.1.1.nupkg.sha512" + }, + "Microsoft.CSharp/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kaj6Wb4qoMuH3HySFJhxwQfe8R/sJsNJnANrvv8WdFPMoNbKY5htfNscv+LHCu5ipz+49m2e+WQXpLXr9XYemQ==", + "path": "microsoft.csharp/4.5.0", + "hashPath": "microsoft.csharp.4.5.0.nupkg.sha512" + }, + "Microsoft.Identity.Client/4.30.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-xk8tJeGfB2yD3+d7a0DXyV7/HYyEG10IofUHYHoPYKmDbroi/j9t1BqSHgbq1nARDjg7m8Ki6e21AyNU7e/R4Q==", + "path": "microsoft.identity.client/4.30.1", + "hashPath": "microsoft.identity.client.4.30.1.nupkg.sha512" + }, + "Microsoft.Identity.Client.Extensions.Msal/2.18.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HpG4oLwhQsy0ce7OWq9iDdLtJKOvKRStIKoSEOeBMKuohfuOWNDyhg8fMAJkpG/kFeoe4J329fiMHcJmmB+FPw==", + "path": "microsoft.identity.client.extensions.msal/2.18.4", + "hashPath": "microsoft.identity.client.extensions.msal.2.18.4.nupkg.sha512" + }, + "Microsoft.NETCore.Platforms/1.1.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TMBuzAHpTenGbGgk0SMTwyEkyijY/Eae4ZGsFNYJvAr/LDn1ku3Etp3FPxChmDp5HHF3kzJuoaa08N0xjqAJfQ==", + "path": "microsoft.netcore.platforms/1.1.1", + "hashPath": "microsoft.netcore.platforms.1.1.1.nupkg.sha512" + }, + "Microsoft.NETCore.Targets/1.1.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Wrmi0kJDzClwAC+iBdUBpEKmEle8FQNsCs77fkiOIw/9oYA07bL1EZNX0kQ2OMN3xpwvl0vAtOCYY3ndDNlhQ==", + "path": "microsoft.netcore.targets/1.1.3", + "hashPath": "microsoft.netcore.targets.1.1.3.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime/2.3.23": { + "type": "package", + "serviceable": true, + "sha512": "sha512-92kNTi1N7zI5wwI2ZXswBRnk61OUYnuYJXrlgOhes5IsAqGmgw9DPGmhUzeY8OaZ8TTrQdDzvgXFnbCHwLzSVA==", + "path": "microsoft.rest.clientruntime/2.3.23", + "hashPath": "microsoft.rest.clientruntime.2.3.23.nupkg.sha512" + }, + "Microsoft.Rest.ClientRuntime.Azure/3.3.19": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+NVBWvRXNwaAPTZUxjUlQggsrf3X0GbiRoxYfgc3kG9E55ZxZxvZPT3nIfC4DNqzGSXUEvmLbckdXgBBzGdUaA==", + "path": "microsoft.rest.clientruntime.azure/3.3.19", + "hashPath": "microsoft.rest.clientruntime.azure.3.3.19.nupkg.sha512" + }, + "Microsoft.Win32.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9ZQKCWxH7Ijp9BfahvL2Zyf1cJIk8XYLF6Yjzr2yi0b2cOut/HQ31qf1ThHAgCc3WiZMdnWcfJCgN82/0UunxA==", + "path": "microsoft.win32.primitives/4.3.0", + "hashPath": "microsoft.win32.primitives.4.3.0.nupkg.sha512" + }, + "Microsoft.Win32.Registry/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Lw1/VwLH1yxz6SfFEjVRCN0pnflLEsWgnV4qsdJ512/HhTwnKXUG+zDQ4yTO3K/EJQemGoNaBHX5InISNKTzUQ==", + "path": "microsoft.win32.registry/4.3.0", + "hashPath": "microsoft.win32.registry.4.3.0.nupkg.sha512" + }, + "NETStandard.Library/2.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==", + "path": "netstandard.library/2.0.3", + "hashPath": "netstandard.library.2.0.3.nupkg.sha512" + }, + "Newtonsoft.Json/10.0.3": { + "type": "package", + "serviceable": true, + "sha512": "sha512-hSXaFmh7hNCuEoC4XNY5DrRkLDzYHqPx/Ik23R4J86Z7PE/Y6YidhG602dFVdLBRSdG6xp9NabH3dXpcoxWvww==", + "path": "newtonsoft.json/10.0.3", + "hashPath": "newtonsoft.json.10.0.3.nupkg.sha512" + }, + "PowerShellStandard.Library/5.1.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iYaRvQsM1fow9h3uEmio+2m2VXfulgI16AYHaTZ8Sf7erGe27Qc8w/h6QL5UPuwv1aXR40QfzMEwcCeiYJp2cw==", + "path": "powershellstandard.library/5.1.0", + "hashPath": "powershellstandard.library.5.1.0.nupkg.sha512" + }, + "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-HdSSp5MnJSsg08KMfZThpuLPJpPwE5hBXvHwoKWosyHHfe8Mh5WKT0ylEOf6yNzX6Ngjxe4Whkafh5q7Ymac4Q==", + "path": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.debian.8-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-+yH1a49wJMy8Zt4yx5RhJrxO/DBDByAiCzNwiETI+1S4mPdCu0OY4djdciC7Vssk0l22wQaDLrXxXkp+3+7bVA==", + "path": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.23-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c3YNH1GQJbfIPJeCnr4avseugSqPrxwIqzthYyZDN6EuOyNOzq+y2KSUfRcXauya1sF4foESTgwM5e1A8arAKw==", + "path": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.fedora.24-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.native.System/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-c/qWt2LieNZIj1jGnVNsE2Kl23Ya2aSTBuXMD6V7k9KWr6l16Tqdwq+hJScEpWER9753NWC8h96PaVNY5Ld7Jw==", + "path": "runtime.native.system/4.3.0", + "hashPath": "runtime.native.system.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Net.Http/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZVuZJqnnegJhd2k/PtAbbIcZ3aZeITq3sj06oKfMBSfphW3HDmk/t4ObvbOk/JA/swGR0LNqMksAh/f7gpTROg==", + "path": "runtime.native.system.net.http/4.3.0", + "hashPath": "runtime.native.system.net.http.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-DloMk88juo0OuOWr56QG7MNchmafTLYWvABy36izkrLI5VledI0rq28KGs1i9wbpeT9NPQrx/wTf8U2vazqQ3Q==", + "path": "runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-NS1U+700m4KFRHR5o4vo9DSlTmlCKu/u7dtE5sUHVIPB+xpXxYQvgBgA6wEIeCz6Yfn0Z52/72WYsToCEPJnrw==", + "path": "runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-b3pthNgxxFcD+Pc0WSEoC0+md3MyhRS6aCEeenvNE3Fdw1HyJ18ZhRFVJJzIeR/O/jpxPboB805Ho0T3Ul7w8A==", + "path": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.13.2-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KeLz4HClKf+nFS7p/6Fi/CqyLXh81FpiGzcmuS8DGi9lUqSnZ6Es23/gv2O+1XVGfrbNmviF7CckBpavkBoIFQ==", + "path": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.opensuse.42.1-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.Apple/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kVXCuMTrTlxq4XOOMAysuNwsXWpYeboGddNGpIgNSZmv1b6r/s/DPk0fYMB7Q5Qo4bY68o48jt4T4y5BVecbCQ==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.apple.4.3.0.nupkg.sha512" + }, + "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X7IdhILzr4ROXd8mI1BUCQMSHSQwelUlBjF1JyTKCjXaOGn2fB4EKBxQbCK2VjO3WaWIdlXZL3W6TiIVnrhX4g==", + "path": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.osx.10.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-nyFNiCk/r+VOiIqreLix8yN+q3Wga9+SE8BCgkf+2BwEKiNx6DyvFjCgkfV743/grxv8jHJ8gUK4XEQw7yzRYg==", + "path": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.rhel.7-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ytoewC6wGorL7KoCAvRfsgoJPJbNq+64k2SqW6JcOAebWsFUvCCYgfzQMrnpvPiEl4OrblUlhF2ji+Q1+SVLrQ==", + "path": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.14.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-I8bKw2I8k58Wx7fMKQJn2R8lamboCAiHfHeV/pS65ScKWMMI0+wJkLYlEKvgW1D/XvSl/221clBoR2q9QNNM7A==", + "path": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.04-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VB5cn/7OzUfzdnC8tqAIMQciVLiq2epm2NrAm1E9OjNRyG4lVhfR61SMcLizejzQP8R8Uf/0l5qOIbUEi+RdEg==", + "path": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl/4.3.0", + "hashPath": "runtime.ubuntu.16.10-x64.runtime.native.system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Buffers/4.5.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Rw7ijyl1qqRS0YQD/WycNst8hUUMgrMH4FCn1nNm27M4VxchZ1js3fVjQaANHO5f3sN4isvP4a+Met9Y4YomAg==", + "path": "system.buffers/4.5.1", + "hashPath": "system.buffers.4.5.1.nupkg.sha512" + }, + "System.Collections/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3Dcj85/TBdVpL5Zr+gEEBUuFe2icOnLalmEh9hfck1PTYbbyWuZgh4fmm2ysCLTrqLQw6t3TgTyJ+VLp+Qb+Lw==", + "path": "system.collections/4.3.0", + "hashPath": "system.collections.4.3.0.nupkg.sha512" + }, + "System.Collections.Concurrent/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ztl69Xp0Y/UXCL+3v3tEU+lIy+bvjKNUmopn1wep/a291pVPK7dxBd6T7WnlQqRog+d1a/hSsgRsmFnIBKTPLQ==", + "path": "system.collections.concurrent/4.3.0", + "hashPath": "system.collections.concurrent.4.3.0.nupkg.sha512" + }, + "System.Collections.NonGeneric/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-prtjIEMhGUnQq6RnPEYLpFt8AtLbp9yq2zxOSrY7KJJZrw25Fi97IzBqY7iqssbM61Ek5b8f3MG/sG1N2sN5KA==", + "path": "system.collections.nongeneric/4.3.0", + "hashPath": "system.collections.nongeneric.4.3.0.nupkg.sha512" + }, + "System.Collections.Specialized/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Epx8PoVZR0iuOnJJDzp7pWvdfMMOAvpUo95pC4ScH2mJuXkKA2Y4aR3cG9qt2klHgSons1WFh4kcGW7cSXvrxg==", + "path": "system.collections.specialized/4.3.0", + "hashPath": "system.collections.specialized.4.3.0.nupkg.sha512" + }, + "System.ComponentModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VyGn1jGRZVfxnh8EdvDCi71v3bMXrsu8aYJOwoV7SNDLVhiEqwP86pPMyRGsDsxhXAm2b3o9OIqeETfN5qfezw==", + "path": "system.componentmodel/4.3.0", + "hashPath": "system.componentmodel.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-j8GUkCpM8V4d4vhLIIoBLGey2Z5bCkMVNjEZseyAlm4n5arcsJOeI3zkUP+zvZgzsbLTYh4lYeP/ZD/gdIAPrw==", + "path": "system.componentmodel.primitives/4.3.0", + "hashPath": "system.componentmodel.primitives.4.3.0.nupkg.sha512" + }, + "System.ComponentModel.TypeConverter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-16pQ6P+EdhcXzPiEK4kbA953Fu0MNG2ovxTZU81/qsCd1zPRsKc3uif5NgvllCY598k6bI0KUyKW8fanlfaDQg==", + "path": "system.componentmodel.typeconverter/4.3.0", + "hashPath": "system.componentmodel.typeconverter.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Debug/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-ZUhUOdqmaG5Jk3Xdb8xi5kIyQYAA4PnTNlHx1mu9ZY3qv4ELIdKbnL/akbGaKi2RnNUWaZsAs31rvzFdewTj2g==", + "path": "system.diagnostics.debug/4.3.0", + "hashPath": "system.diagnostics.debug.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.DiagnosticSource/4.6.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-mbBgoR0rRfl2uimsZ2avZY8g7Xnh1Mza0rJZLPcxqiMWlkGukjmRkuMJ/er+AhQuiRIh80CR/Hpeztr80seV5g==", + "path": "system.diagnostics.diagnosticsource/4.6.0", + "hashPath": "system.diagnostics.diagnosticsource.4.6.0.nupkg.sha512" + }, + "System.Diagnostics.Process/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-J0wOX07+QASQblsfxmIMFc9Iq7KTXYL3zs2G/Xc704Ylv3NpuVdo6gij6V3PGiptTxqsK0K7CdXenRvKUnkA2g==", + "path": "system.diagnostics.process/4.3.0", + "hashPath": "system.diagnostics.process.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tools/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-UUvkJfSYJMM6x527dJg2VyWPSRqIVB0Z7dbjHst1zmwTXz5CcXSYJFWRpuigfbO1Lf7yfZiIaEUesfnl/g5EyA==", + "path": "system.diagnostics.tools/4.3.0", + "hashPath": "system.diagnostics.tools.4.3.0.nupkg.sha512" + }, + "System.Diagnostics.Tracing/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rswfv0f/Cqkh78rA5S8eN8Neocz234+emGCtTF3lxPY96F+mmmUen6tbn0glN6PMvlKQb9bPAY5e9u7fgPTkKw==", + "path": "system.diagnostics.tracing/4.3.0", + "hashPath": "system.diagnostics.tracing.4.3.0.nupkg.sha512" + }, + "System.Dynamic.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-SNVi1E/vfWUAs/WYKhE9+qlS6KqK0YVhnlT0HQtr8pMIA8YX3lwy3uPMownDwdYISBdmAF/2holEIldVp85Wag==", + "path": "system.dynamic.runtime/4.3.0", + "hashPath": "system.dynamic.runtime.4.3.0.nupkg.sha512" + }, + "System.Globalization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-kYdVd2f2PAdFGblzFswE4hkNANJBKRmsfa2X5LG2AcWE1c7/4t0pYae1L8vfZ5xvE2nK/R9JprtToA61OSHWIg==", + "path": "system.globalization/4.3.0", + "hashPath": "system.globalization.4.3.0.nupkg.sha512" + }, + "System.Globalization.Calendars/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GUlBtdOWT4LTV3I+9/PJW+56AnnChTaOqqTLFtdmype/L500M2LIyXgmtd9X2P2VOkmJd5c67H5SaC2QcL1bFA==", + "path": "system.globalization.calendars/4.3.0", + "hashPath": "system.globalization.calendars.4.3.0.nupkg.sha512" + }, + "System.Globalization.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-FhKmdR6MPG+pxow6wGtNAWdZh7noIOpdD5TwQ3CprzgIE1bBBoim0vbR1+AWsWjQmU7zXHgQo4TWSP6lCeiWcQ==", + "path": "system.globalization.extensions/4.3.0", + "hashPath": "system.globalization.extensions.4.3.0.nupkg.sha512" + }, + "System.IO/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3qjaHvxQPDpSOYICjUoTsmoq5u6QJAFRUITgeT/4gqkF1bajbSmb1kwSxEA8AHlofqgcKJcM8udgieRNhaJ5Cg==", + "path": "system.io/4.3.0", + "hashPath": "system.io.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-3wEMARTnuio+ulnvi+hkRNROYwa1kylvYahhcLk4HSoVdl+xxTFVeVlYOfLwrDPImGls0mDqbMhrza8qnWPTdA==", + "path": "system.io.filesystem/4.3.0", + "hashPath": "system.io.filesystem.4.3.0.nupkg.sha512" + }, + "System.IO.FileSystem.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-6QOb2XFLch7bEc4lIcJH49nJN2HV+OC3fHDgsLVsBVBk3Y4hFAnOBGzJ2lUu7CyDDFo9IBWkSsnbkT6IBwwiMw==", + "path": "system.io.filesystem.primitives/4.3.0", + "hashPath": "system.io.filesystem.primitives.4.3.0.nupkg.sha512" + }, + "System.Linq/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5DbqIUpsDp0dFftytzuMmc0oeMdQwjcP/EWxsksIz/w1TcFRkZ3yKKz0PqiYFMmEwPSWw+qNVqD7PJ889JzHbw==", + "path": "system.linq/4.3.0", + "hashPath": "system.linq.4.3.0.nupkg.sha512" + }, + "System.Linq.Expressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PGKkrd2khG4CnlyJwxwwaWWiSiWFNBGlgXvJpeO0xCXrZ89ODrQ6tjEWS/kOqZ8GwEOUATtKtzp1eRgmYNfclg==", + "path": "system.linq.expressions/4.3.0", + "hashPath": "system.linq.expressions.4.3.0.nupkg.sha512" + }, + "System.Memory/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1MbJTHS1lZ4bS4FmsJjnuGJOu88ZzTT2rLvrhW7Ygic+pC0NWA+3hgAen0HRdsocuQXCkUTdFn9yHJJhsijDXw==", + "path": "system.memory/4.5.4", + "hashPath": "system.memory.4.5.4.nupkg.sha512" + }, + "System.Memory.Data/1.0.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JGkzeqgBsiZwKJZ1IxPNsDFZDhUvuEdX8L8BDC8N3KOj+6zMcNU28CNN59TpZE/VJYy9cP+5M+sbxtWJx3/xtw==", + "path": "system.memory.data/1.0.2", + "hashPath": "system.memory.data.1.0.2.nupkg.sha512" + }, + "System.Numerics.Vectors/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-QQTlPTl06J/iiDbJCiepZ4H//BVraReU4O4EoRw1U02H5TLUIT7xn3GnDp9AXPSlJUDyFs4uWjWafNX6WrAojQ==", + "path": "system.numerics.vectors/4.5.0", + "hashPath": "system.numerics.vectors.4.5.0.nupkg.sha512" + }, + "System.ObjectModel/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-bdX+80eKv9bN6K4N+d77OankKHGn6CH711a6fcOpMQu2Fckp/Ft4L/kW9WznHpyR0NRAvJutzOMHNNlBGvxQzQ==", + "path": "system.objectmodel/4.3.0", + "hashPath": "system.objectmodel.4.3.0.nupkg.sha512" + }, + "System.Private.DataContractSerialization/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yDaJ2x3mMmjdZEDB4IbezSnCsnjQ4BxinKhRAaP6kEgL6Bb6jANWphs5SzyD8imqeC/3FxgsuXT6ykkiH1uUmA==", + "path": "system.private.datacontractserialization/4.3.0", + "hashPath": "system.private.datacontractserialization.4.3.0.nupkg.sha512" + }, + "System.Private.Uri/4.3.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-o1+7RJnu3Ik3PazR7Z7tJhjPdE000Eq2KGLLWhqJJKXj04wrS8lwb1OFtDF9jzXXADhUuZNJZlPc98uwwqmpFA==", + "path": "system.private.uri/4.3.2", + "hashPath": "system.private.uri.4.3.2.nupkg.sha512" + }, + "System.Reflection/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KMiAFoW7MfJGa9nDFNcfu+FpEdiHpWgTcS2HdMpDvt9saK3y/G4GwprPyzqjFH9NTaGPQeWNHU+iDlDILj96aQ==", + "path": "system.reflection/4.3.0", + "hashPath": "system.reflection.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-228FG0jLcIwTVJyz8CLFKueVqQK36ANazUManGaJHkO0icjiIypKW7YLWLIWahyIkdh5M7mV2dJepllLyA1SKg==", + "path": "system.reflection.emit/4.3.0", + "hashPath": "system.reflection.emit.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.ILGeneration/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-59tBslAk9733NXLrUJrwNZEzbMAcu8k344OYo+wfSVygcgZ9lgBdGIzH/nrg3LYhXceynyvTc8t5/GD4Ri0/ng==", + "path": "system.reflection.emit.ilgeneration/4.3.0", + "hashPath": "system.reflection.emit.ilgeneration.4.3.0.nupkg.sha512" + }, + "System.Reflection.Emit.Lightweight/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-oadVHGSMsTmZsAF864QYN1t1QzZjIcuKU3l2S9cZOwDdDueNTrqq1yRj7koFfIGEnKpt6NjpL3rOzRhs4ryOgA==", + "path": "system.reflection.emit.lightweight/4.3.0", + "hashPath": "system.reflection.emit.lightweight.4.3.0.nupkg.sha512" + }, + "System.Reflection.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-rJkrJD3kBI5B712aRu4DpSIiHRtr6QlfZSQsb0hYHrDCZORXCFjQfoipo2LaMUHoT9i1B7j7MnfaEKWDFmFQNQ==", + "path": "system.reflection.extensions/4.3.0", + "hashPath": "system.reflection.extensions.4.3.0.nupkg.sha512" + }, + "System.Reflection.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5RXItQz5As4xN2/YUDxdpsEkMhvw3e6aNveFXUn4Hl/udNTCNhnKp8lT9fnc3MhvGKh1baak5CovpuQUXHAlIA==", + "path": "system.reflection.primitives/4.3.0", + "hashPath": "system.reflection.primitives.4.3.0.nupkg.sha512" + }, + "System.Reflection.TypeExtensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7u6ulLcZbyxB5Gq0nMkQttcdBTx57ibzw+4IOXEfR+sXYQoHvjW5LTLyNr8O22UIMrqYbchJQJnos4eooYzYJA==", + "path": "system.reflection.typeextensions/4.3.0", + "hashPath": "system.reflection.typeextensions.4.3.0.nupkg.sha512" + }, + "System.Resources.ResourceManager/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-/zrcPkkWdZmI4F92gL/TPumP98AVDu/Wxr3CSJGQQ+XN6wbRZcyfSKVoPo17ilb3iOr0cCRqJInGwNMolqhS8A==", + "path": "system.resources.resourcemanager/4.3.0", + "hashPath": "system.resources.resourcemanager.4.3.0.nupkg.sha512" + }, + "System.Runtime/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-JufQi0vPQ0xGnAczR13AUFglDyVYt4Kqnz1AZaiKZ5+GICq0/1MH/mO/eAJHt/mHW1zjKBJd7kV26SrxddAhiw==", + "path": "system.runtime/4.3.0", + "hashPath": "system.runtime.4.3.0.nupkg.sha512" + }, + "System.Runtime.CompilerServices.Unsafe/4.7.1": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zOHkQmzPCn5zm/BH+cxC1XbUS3P4Yoi3xzW7eRgVpDR2tPGSzyMZ17Ig1iRkfJuY0nhxkQQde8pgePNiA7z7TQ==", + "path": "system.runtime.compilerservices.unsafe/4.7.1", + "hashPath": "system.runtime.compilerservices.unsafe.4.7.1.nupkg.sha512" + }, + "System.Runtime.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-guW0uK0fn5fcJJ1tJVXYd7/1h5F+pea1r7FLSOz/f8vPEqbR2ZAknuRDvTQ8PzAilDveOxNjSfr0CHfIQfFk8g==", + "path": "system.runtime.extensions/4.3.0", + "hashPath": "system.runtime.extensions.4.3.0.nupkg.sha512" + }, + "System.Runtime.Handles/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OKiSUN7DmTWeYb3l51A7EYaeNMnvxwE249YtZz7yooT4gOZhmTjIn48KgSsw2k2lYdLgTKNJw/ZIfSElwDRVgg==", + "path": "system.runtime.handles/4.3.0", + "hashPath": "system.runtime.handles.4.3.0.nupkg.sha512" + }, + "System.Runtime.InteropServices/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-uv1ynXqiMK8mp1GM3jDqPCFN66eJ5w5XNomaK2XD+TuCroNTLFGeZ+WCmBMcBDyTFKou3P6cR6J/QsaqDp7fGQ==", + "path": "system.runtime.interopservices/4.3.0", + "hashPath": "system.runtime.interopservices.4.3.0.nupkg.sha512" + }, + "System.Runtime.Numerics/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-yMH+MfdzHjy17l2KESnPiF2dwq7T+xLnSJar7slyimAkUh/gTrS9/UQOtv7xarskJ2/XDSNvfLGOBQPjL7PaHQ==", + "path": "system.runtime.numerics/4.3.0", + "hashPath": "system.runtime.numerics.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Formatters/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-KT591AkTNFOTbhZlaeMVvfax3RqhH1EJlcwF50Wm7sfnBLuHiOeZRRKrr1ns3NESkM20KPZ5Ol/ueMq5vg4QoQ==", + "path": "system.runtime.serialization.formatters/4.3.0", + "hashPath": "system.runtime.serialization.formatters.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Json/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-CpVfOH0M/uZ5PH+M9+Gu56K0j9lJw3M+PKRegTkcrY/stOIvRUeonggxNrfBYLA5WOHL2j15KNJuTuld3x4o9w==", + "path": "system.runtime.serialization.json/4.3.0", + "hashPath": "system.runtime.serialization.json.4.3.0.nupkg.sha512" + }, + "System.Runtime.Serialization.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-Wz+0KOukJGAlXjtKr+5Xpuxf8+c8739RI1C+A2BoQZT+wMCCoMDDdO8/4IRHfaVINqL78GO8dW8G2lW/e45Mcw==", + "path": "system.runtime.serialization.primitives/4.3.0", + "hashPath": "system.runtime.serialization.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.AccessControl/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-vW8Eoq0TMyz5vAG/6ce483x/CP83fgm4SJe5P8Tb1tZaobcvPrbMEL7rhH1DRdrYbbb6F0vq3OlzmK0Pkwks5A==", + "path": "system.security.accesscontrol/4.5.0", + "hashPath": "system.security.accesscontrol.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.Algorithms/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-W1kd2Y8mYSCgc3ULTAZ0hOP2dSdG5YauTb1089T0/kRcN2MpSAW1izOFROrJgxSlMn3ArsgHXagigyi+ibhevg==", + "path": "system.security.cryptography.algorithms/4.3.0", + "hashPath": "system.security.cryptography.algorithms.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Cng/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-03idZOqFlsKRL4W+LuCpJ6dBYDUWReug6lZjBa3uJWnk5sPCUXckocevTaUA8iT/MFSrY/2HXkOt753xQ/cf8g==", + "path": "system.security.cryptography.cng/4.3.0", + "hashPath": "system.security.cryptography.cng.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Csp/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-X4s/FCkEUnRGnwR3aSfVIkldBmtURMhmexALNTwpjklzxWU7yjMk7GHLKOZTNkgnWnE0q7+BCf9N2LVRWxewaA==", + "path": "system.security.cryptography.csp/4.3.0", + "hashPath": "system.security.cryptography.csp.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-1DEWjZZly9ae9C79vFwqaO5kaOlI5q+3/55ohmq/7dpDyDfc8lYe7YVxJUZ5MF/NtbkRjwFRo14yM4OEo9EmDw==", + "path": "system.security.cryptography.encoding/4.3.0", + "hashPath": "system.security.cryptography.encoding.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.OpenSsl/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-h4CEgOgv5PKVF/HwaHzJRiVboL2THYCou97zpmhjghx5frc7fIvlkY1jL+lnIQyChrJDMNEXS6r7byGif8Cy4w==", + "path": "system.security.cryptography.openssl/4.3.0", + "hashPath": "system.security.cryptography.openssl.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.Primitives/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-7bDIyVFNL/xKeFHjhobUAQqSpJq9YTOpbEs6mR233Et01STBMXNAc/V+BM6dwYGc95gVh/Zf+iVXWzj3mE8DWg==", + "path": "system.security.cryptography.primitives/4.3.0", + "hashPath": "system.security.cryptography.primitives.4.3.0.nupkg.sha512" + }, + "System.Security.Cryptography.ProtectedData/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-wLBKzFnDCxP12VL9ANydSYhk59fC4cvOr9ypYQLPnAj48NQIhqnjdD2yhP8yEKyBJEjERWS9DisKL7rX5eU25Q==", + "path": "system.security.cryptography.protecteddata/4.5.0", + "hashPath": "system.security.cryptography.protecteddata.4.5.0.nupkg.sha512" + }, + "System.Security.Cryptography.X509Certificates/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-t2Tmu6Y2NtJ2um0RtcuhP7ZdNNxXEgUm2JeoA/0NvlMjAhKCnM1NX07TDl3244mVp3QU6LPEhT3HTtH1uF7IYw==", + "path": "system.security.cryptography.x509certificates/4.3.0", + "hashPath": "system.security.cryptography.x509certificates.4.3.0.nupkg.sha512" + }, + "System.Security.Permissions/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-9gdyuARhUR7H+p5CjyUB/zPk7/Xut3wUSP8NJQB6iZr8L3XUXTMdoLeVAg9N4rqF8oIpE7MpdqHdDHQ7XgJe0g==", + "path": "system.security.permissions/4.5.0", + "hashPath": "system.security.permissions.4.5.0.nupkg.sha512" + }, + "System.Security.Principal.Windows/4.5.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-U77HfRXlZlOeIXd//Yoj6Jnk8AXlbeisf1oq1os+hxOGVnuG+lGSfGqTwTZBoORFF6j/0q7HXIl8cqwQ9aUGqQ==", + "path": "system.security.principal.windows/4.5.0", + "hashPath": "system.security.principal.windows.4.5.0.nupkg.sha512" + }, + "System.Security.SecureString/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-PnXp38O9q/2Oe4iZHMH60kinScv6QiiL2XH54Pj2t0Y6c2zKPEiAZsM/M3wBOHLNTBDFP0zfy13WN2M0qFz5jg==", + "path": "system.security.securestring/4.3.0", + "hashPath": "system.security.securestring.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-BiIg+KWaSDOITze6jGQynxg64naAPtqGHBwDrLaCtixsa5bKiR8dpPOHA7ge3C0JJQizJE+sfkz1wV+BAKAYZw==", + "path": "system.text.encoding/4.3.0", + "hashPath": "system.text.encoding.4.3.0.nupkg.sha512" + }, + "System.Text.Encoding.Extensions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-YVMK0Bt/A43RmwizJoZ22ei2nmrhobgeiYwFzC4YAN+nue8RF6djXDMog0UCn+brerQoYVyaS+ghy9P/MUVcmw==", + "path": "system.text.encoding.extensions/4.3.0", + "hashPath": "system.text.encoding.extensions.4.3.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-iTUgB/WtrZ1sWZs84F2hwyQhiRH6QNjQv2DkwrH+WP6RoFga2Q1m3f9/Q7FG8cck8AdHitQkmkXSY8qylcDmuA==", + "path": "system.text.encodings.web/4.7.2", + "hashPath": "system.text.encodings.web.4.7.2.nupkg.sha512" + }, + "System.Text.Json/4.7.2": { + "type": "package", + "serviceable": true, + "sha512": "sha512-TcMd95wcrubm9nHvJEQs70rC0H/8omiSGGpU4FQ/ZA1URIqD4pjmFJh2Mfv1yH1eHgJDWTi2hMDXwTET+zOOyg==", + "path": "system.text.json/4.7.2", + "hashPath": "system.text.json.4.7.2.nupkg.sha512" + }, + "System.Text.RegularExpressions/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-RpT2DA+L660cBt1FssIE9CAGpLFdFPuheB7pLpKpn6ZXNby7jDERe8Ua/Ne2xGiwLVG2JOqziiaVCGDon5sKFA==", + "path": "system.text.regularexpressions/4.3.0", + "hashPath": "system.text.regularexpressions.4.3.0.nupkg.sha512" + }, + "System.Threading/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-VkUS0kOBcUf3Wwm0TSbrevDDZ6BlM+b/HRiapRFWjM5O0NS0LviG0glKmFK+hhPDd1XFeSdU1GmlLhb2CoVpIw==", + "path": "system.threading/4.3.0", + "hashPath": "system.threading.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-LbSxKEdOUhVe8BezB/9uOGGppt+nZf6e1VFyw6v3DN6lqitm0OSn2uXMOdtP0M3W4iMcqcivm2J6UgqiwwnXiA==", + "path": "system.threading.tasks/4.3.0", + "hashPath": "system.threading.tasks.4.3.0.nupkg.sha512" + }, + "System.Threading.Tasks.Extensions/4.5.4": { + "type": "package", + "serviceable": true, + "sha512": "sha512-zteT+G8xuGu6mS+mzDzYXbzS7rd3K6Fjb9RiZlYlJPam2/hU7JCBZBVEcywNuR+oZ1ncTvc/cq0faRr3P01OVg==", + "path": "system.threading.tasks.extensions/4.5.4", + "hashPath": "system.threading.tasks.extensions.4.5.4.nupkg.sha512" + }, + "System.Threading.Thread/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-OHmbT+Zz065NKII/ZHcH9XO1dEuLGI1L2k7uYss+9C1jLxTC9kTZZuzUOyXHayRk+dft9CiDf3I/QZ0t8JKyBQ==", + "path": "system.threading.thread/4.3.0", + "hashPath": "system.threading.thread.4.3.0.nupkg.sha512" + }, + "System.Threading.ThreadPool/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-k/+g4b7vjdd4aix83sTgC9VG6oXYKAktSfNIJUNGxPEj7ryEOfzHHhfnmsZvjxawwcD9HyWXKCXmPjX8U4zeSw==", + "path": "system.threading.threadpool/4.3.0", + "hashPath": "system.threading.threadpool.4.3.0.nupkg.sha512" + }, + "System.Xml.ReaderWriter/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-GrprA+Z0RUXaR4N7/eW71j1rgMnEnEVlgii49GZyAjTH7uliMnrOU3HNFBr6fEDBCJCIdlVNq9hHbaDR621XBA==", + "path": "system.xml.readerwriter/4.3.0", + "hashPath": "system.xml.readerwriter.4.3.0.nupkg.sha512" + }, + "System.Xml.XDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-5zJ0XDxAIg8iy+t4aMnQAu0MqVbqyvfoUVl1yDV61xdo3Vth45oA2FoY4pPkxYAH5f8ixpmTqXeEIya95x0aCQ==", + "path": "system.xml.xdocument/4.3.0", + "hashPath": "system.xml.xdocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlDocument/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-lJ8AxvkX7GQxpC6GFCeBj8ThYVyQczx2+f/cWHJU8tjS7YfI6Cv6bon70jVEgs2CiFbmmM8b9j1oZVx0dSI2Ww==", + "path": "system.xml.xmldocument/4.3.0", + "hashPath": "system.xml.xmldocument.4.3.0.nupkg.sha512" + }, + "System.Xml.XmlSerializer/4.3.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-MYoTCP7EZ98RrANESW05J5ZwskKDoN0AuZ06ZflnowE50LTpbR5yRg3tHckTVm5j/m47stuGgCrCHWePyHS70Q==", + "path": "system.xml.xmlserializer/4.3.0", + "hashPath": "system.xml.xmlserializer.4.3.0.nupkg.sha512" + }, + "Microsoft.Azure.PowerShell.Authentication/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authentication.ResourceManager/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "Microsoft.Azure.PowerShell.Authenticators/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll new file mode 100644 index 000000000000..2eff02a0138e Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml new file mode 100644 index 000000000000..85f85750523b --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Cmdlets.Accounts.dll-Help.xml @@ -0,0 +1,11900 @@ + + + + + Add-AzEnvironment + Add + AzEnvironment + + Adds endpoints and metadata for an instance of Azure Resource Manager. + + + + The Add-AzEnvironment cmdlet adds endpoints and metadata to enable Azure Resource Manager cmdlets to connect with a new instance of Azure Resource Manager. The built-in environments AzureCloud and AzureChinaCloud target existing public instances of Azure Resource Manager. + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Add-AzEnvironment + + AutoDiscover + + Discovers environments via default or configured endpoint. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint + + System.String + + System.String + + + None + + + AutoDiscover + + Discovers environments via default or configured endpoint. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to add. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Uri + + Specifies URI of the internet resource to fetch environments. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : +VersionProfiles : {} +ExtendedProperties : {} +BatchEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + ------- Example 2: Discovering a new environment via Uri ------- + <# +Uri https://configuredmetadata.net returns an array of environment metadata. The following example contains a payload for the AzureCloud default environment. + +[ + { + "portal": "https://portal.azure.com", + "authentication": { + "loginEndpoint": "https://login.microsoftonline.com/", + "audiences": [ + "https://management.core.windows.net/" + ], + "tenant": "common", + "identityProvider": "AAD" + }, + "media": "https://rest.media.azure.net", + "graphAudience": "https://graph.windows.net/", + "graph": "https://graph.windows.net/", + "name": "AzureCloud", + "suffixes": { + "azureDataLakeStoreFileSystem": "azuredatalakestore.net", + "acrLoginServer": "azurecr.io", + "sqlServerHostname": ".database.windows.net", + "azureDataLakeAnalyticsCatalogAndJob": "azuredatalakeanalytics.net", + "keyVaultDns": "vault.azure.net", + "storage": "core.windows.net", + "azureFrontDoorEndpointSuffix": "azurefd.net" + }, + "batch": "https://batch.core.windows.net/", + "resourceManager": "https://management.azure.com/", + "vmImageAliasDoc": "https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/arm-compute/quickstart-templates/aliases.json", + "activeDirectoryDataLake": "https://datalake.azure.net/", + "sqlManagement": "https://management.core.windows.net:8443/", + "gallery": "https://gallery.azure.com/" + }, +…… +] +#> + +Add-AzEnvironment -AutoDiscover -Uri https://configuredmetadata.net + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + In this example, we are discovering a new Azure environment from the `https://configuredmetadata.net` Uri. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/add-azenvironment + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Clear-AzContext + Clear + AzContext + + Remove all Azure credentials, account, and subscription information. + + + + Remove all Azure Credentials, account, and subscription information. + + + + Clear-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Delete all users and groups from the global scope without prompting + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return a value indicating success or failure + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Clear the context only for the current PowerShell session, or for all sessions. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + --------------- Example 1: Clear global context --------------- + Clear-AzContext -Scope CurrentUser + + Remove all account, subscription, and credential information for any powershell session. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azcontext + + + + + + Clear-AzDefault + Clear + AzDefault + + Clears the defaults set by the user in the current context. + + + + The Clear-AzDefault cmdlet removes the defaults set by the user depending on the switch parameters specified by the user. + + + + Clear-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove all defaults if no default is specified + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + {{Fill PassThru Description}} + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroup + + Clear Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + System.Boolean + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Clear-AzDefault + + This command removes all the defaults set by the user in the current context. + + + + + + -------------------------- Example 2 -------------------------- + Clear-AzDefault -ResourceGroup + + This command removes the default resource group set by the user in the current context. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/clear-azdefault + + + + + + Connect-AzAccount + Connect + AzAccount + + Connect to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. + + + + The `Connect-AzAccount` cmdlet connects to Azure with an authenticated account for use with cmdlets from the Az PowerShell modules. You can use this authenticated account only with Azure Resource Manager requests. To add an authenticated account for use with Service Management, use the `Add-AzureAccount` cmdlet from the Azure PowerShell module. If no context is found for the current user, the user's context list is populated with a context for each of their first 25 subscriptions. The list of contexts created for the user can be found by running `Get-AzContext -ListAvailable`. To skip this context population, specify the SkipContextPopulation switch parameter. After executing this cmdlet, you can disconnect from an Azure account using `Disconnect-AzAccount`. + + + + Connect-AzAccount + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + Identity + + Login using a Managed Service Identity. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Connect-AzAccount + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + + System.Management.Automation.SwitchParameter + + + False + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SkipContextPopulation + + Skips context population if no contexts are found. + + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AccessToken + + Specifies an access token. + > [!CAUTION] > Access tokens are a type of credential. You should take the appropriate security precautions to > keep them confidential. Access tokens also timeout and may prevent long running tasks from > completing. + + System.String + + System.String + + + None + + + AccountId + + Account Id / User Id / User Name to login with in Default (UserWithSubscriptionId) parameter set; Account ID for access token in AccessToken parameter set; Account ID for managed service in ManagedService parameter set. Can be a managed service resource ID, or the associated client ID. To use the system assigned identity, leave this field blank. + + System.String + + System.String + + + None + + + ApplicationId + + Application ID of the service principal. + + System.String + + System.String + + + None + + + AuthScope + + Optional OAuth scope for login, supported pre-defined values: AadGraph, AnalysisServices, Attestation, Batch, DataLake, KeyVault, OperationalInsights, Storage, Synapse. It also supports resource id like `https://storage.azure.com/`. + + System.String + + System.String + + + None + + + CertificatePassword + + The password required to access the pkcs#12 certificate file. + + System.Security.SecureString + + System.Security.SecureString + + + None + + + CertificatePath + + The path of certficate file in pkcs#12 format. + + System.String + + System.String + + + None + + + CertificateThumbprint + + Certificate Hash or Thumbprint. + + System.String + + System.String + + + None + + + ContextName + + Name of the default Azure context for this login. For more information about Azure contexts, see Azure PowerShell context objects (/powershell/azure/context-persistence). + + System.String + + System.String + + + None + + + Credential + + Specifies a PSCredential object. For more information about the PSCredential object, type `Get-Help Get-Credential`. The PSCredential object provides the user ID and password for organizational ID credentials, or the application ID and secret for service principal credentials. + + System.Management.Automation.PSCredential + + System.Management.Automation.PSCredential + + + None + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Environment + + Environment containing the Azure account. + + System.String + + System.String + + + None + + + FederatedToken + + Specifies a token provided by another identity provider. The issuer and subject in this token must be first configured to be trusted by the ApplicationId. + > [!CAUTION] > Federated tokens are a type of credential. You should take the appropriate security precautions to keep them confidential. Federated tokens also timeout and may prevent long running tasks from completing. + + System.String + + System.String + + + None + + + Force + + Overwrite the existing context with the same name without prompting. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GraphAccessToken + + AccessToken for Graph Service. + + System.String + + System.String + + + None + + + Identity + + Login using a Managed Service Identity. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + KeyVaultAccessToken + + AccessToken for KeyVault Service. + + System.String + + System.String + + + None + + + MaxContextPopulation + + Max subscription number to populate contexts after login. Default is 25. To populate all subscriptions to contexts, set to -1. + + System.Int32 + + System.Int32 + + + None + + + MicrosoftGraphAccessToken + + Access token to Microsoft Graph + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SendCertificateChain + + Specifies if the x5c claim (public key of the certificate) should be sent to the STS to achieve easy certificate rollover in Azure AD. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ServicePrincipal + + Indicates that this account authenticates by providing service principal credentials. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipContextPopulation + + Skips context population if no contexts are found. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + SkipValidation + + Skip validation for access token. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Subscription + + Subscription Name or ID. + + System.String + + System.String + + + None + + + Tenant + + Optional tenant name or ID. + > [!NOTE] > Due to limitations of the current API, you must use a tenant ID instead of a tenant name when > connecting with a business-to-business (B2B) account. + + System.String + + System.String + + + None + + + UseDeviceAuthentication + + Use device code authentication instead of a browser control. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------------ Example 1: Connect to an Azure account ------------ + Connect-AzAccount + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 2: Connect to Azure using organizational ID credentials + $Credential = Get-Credential +Connect-AzAccount -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 3: Connect to Azure using a service principal account + $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList $ApplicationId, $SecuredPassword +Connect-AzAccount -ServicePrincipal -TenantId $TenantId -Credential $Credential + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxx-xxxx-xxxx-xxxx Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 4: Use an interactive login to connect to a specific tenant and subscription + Connect-AzAccount -Tenant 'xxxx-xxxx-xxxx-xxxx' -SubscriptionId 'yyyy-yyyy-yyyy-yyyy' + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ----- Example 5: Connect using a Managed Service Identity ----- + Connect-AzAccount -Identity + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +MSI@50342 Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + Example 6: Connect using Managed Service Identity login and ClientId + $identity = Get-AzUserAssignedIdentity -ResourceGroupName 'myResourceGroup' -Name 'myUserAssignedIdentity' +Get-AzVM -ResourceGroupName contoso -Name testvm | Update-AzVM -IdentityType UserAssigned -IdentityId $identity.Id +Connect-AzAccount -Identity -AccountId $identity.ClientId # Run on the virtual machine + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ------------ Example 7: Connect using certificates ------------ + $Thumbprint = 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = '00000000-0000-0000-0000-00000000' +Connect-AzAccount -CertificateThumbprint $Thumbprint -ApplicationId $ApplicationId -Tenant $TenantId -ServicePrincipal + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + +Account : xxxxxxxx-xxxx-xxxx-xxxxxxxx +SubscriptionName : MyTestSubscription +SubscriptionId : zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz +TenantId : yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy +Environment : AzureCloud + + + + + + + + -------------- Example 8: Connect with AuthScope -------------- + Connect-AzAccount -AuthScope Storage + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +yyyy-yyyy-yyyy-yyyy Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + + + + + + + ---------- Example 9: Connect using certificate file ---------- + $securePassword = $plainPassword | ConvertTo-SecureString -AsPlainText -Force +$TenantId = 'yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy' +$ApplicationId = 'zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzz' +Connect-AzAccount -ServicePrincipal -ApplicationId $ApplicationId -TenantId $TenantId -CertificatePath './certificatefortest.pfx' -CertificatePassword $securePassword + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +xxxxxxxx-xxxx-xxxx-xxxxxxxx Subscription1 yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyy AzureCloud + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/connect-azaccount + + + + + + Disable-AzContextAutosave + Disable + AzContextAutosave + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Turn off autosaving Azure credentials. Your login information will be forgotten the next time you open a PowerShell window + + + + Disable-AzContextAutosave + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ---------- Example 1: Disable autosaving the context ---------- + Disable-AzContextAutosave + + Disable autosave for the current user. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Disable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azcontextautosave + + + + + + Disable-AzDataCollection + Disable + AzDataCollection + + Opts out of collecting data to improve the Azure PowerShell cmdlets. Data is collected by default unless you explicitly opt out. + + + + The `Disable-AzDataCollection` cmdlet is used to opt out of data collection. Azure PowerShell automatically collects telemetry data by default. To disable data collection, you must explicitly opt-out. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. If you've previously opted out, run the `Enable-AzDataCollection` cmdlet to re-enable data collection for the current user on the current machine. + + + + Disable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -- Example 1: Disabling data collection for the current user -- + Disable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azdatacollection + + + Enable-AzDataCollection + + + + + + + Disable-AzureRmAlias + Disable + AzureRmAlias + + Disables AzureRm prefix aliases for Az modules. + + + + Disables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases disabled. Otherwise all AzureRm aliases are disabled. + + + + Disable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to disable aliases for. If none are specified, default is all enabled modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all disabled aliases + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be disabled for. Default is 'Process' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Disable-AzureRmAlias + + Disables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Disable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Disables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disable-azurermalias + + + + + + Disconnect-AzAccount + Disconnect + AzAccount + + Disconnects a connected Azure account and removes all credentials and contexts associated with that account. + + + + The Disconnect-AzAccount cmdlet disconnects a connected Azure account and removes all credentials and contexts (subscription and tenant information) associated with that account. After executing this cmdlet, you will need to login again using Connect-AzAccount. + + + + Disconnect-AzAccount + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + Disconnect-AzAccount + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApplicationId + + ServicePrincipal id (globally unique id) + + System.String + + System.String + + + None + + + AzureContext + + Context + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + ContextName + + Name of the context to log out of + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + The account object to remove + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + TenantId + + Tenant id (globally unique id) + + System.String + + System.String + + + None + + + Username + + User name of the form 'user@contoso.org' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not executed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureRmAccount + + + + + + + + + + + + + + ----------- Example 1: Logout of the current account ----------- + Disconnect-AzAccount + + Logs out of the Azure account associated with the current context. + + + + + + Example 2: Logout of the account associated with a particular context + Get-AzContext "Work" | Disconnect-AzAccount -Scope CurrentUser + + Logs out the account associated with the given context (named 'Work'). Because this uses the 'CurrentUser' scope, all credentials and contexts will be permanently deleted. + + + + + + ------------- Example 3: Log out a particular user ------------- + Disconnect-AzAccount -Username 'user1@contoso.org' + + Logs out the 'user1@contoso.org' user - all credentials and all contexts associated with this user will be removed. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/disconnect-azaccount + + + + + + Enable-AzContextAutosave + Enable + AzContextAutosave + + Azure contexts are PowerShell objects representing your active subscription to run commands against, and the authentication information needed to connect to an Azure cloud. With Azure contexts, Azure PowerShell doesn't need to reauthenticate your account each time you switch subscriptions. For more information, see Azure PowerShell context objects (https://docs.microsoft.com/powershell/azure/context-persistence). + This cmdlet allows the Azure context information to be saved and automatically loaded when you start a PowerShell process. For example, when opening a new window. + + + + Allows the Azure context information to be saved and automatically loaded when a PowerShell process starts. The context is saved at the end of the execution of any cmdlet that affects the context. For example, any profile cmdlet. If you're using user authentication, then tokens can be updated during the course of running any cmdlet. + + + + Enable-AzContextAutosave + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with Azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes. For example, whether changes apply only to the current process, or to all sessions started by this user. Changes made with the scope `CurrentUser` will affect all PowerShell sessions started by the user. If a particular session needs to have different settings, use the scope `Process`. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + CurrentUser + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet isn't run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + Example 1: Enable autosaving credentials for the current user + Enable-AzContextAutosave + + + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Enable-AzContextAutosave -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azcontextautosave + + + + + + Enable-AzDataCollection + Enable + AzDataCollection + + Enables Azure PowerShell to collect data to improve the user experience with the Azure PowerShell cmdlets. Executing this cmdlet opts in to data collection for the current user on the current machine. Data is collected by default unless you explicitly opt out. + + + + The `Enable-AzDataCollection` cmdlet is used to opt in to data collection. Azure PowerShell automatically collects telemetry data by default. Microsoft aggregates collected data to identify patterns of usage, to identify common issues, and to improve the experience of Azure PowerShell. Microsoft Azure PowerShell doesn't collect any private or personal data. To disable data collection, you must explicitly opt out by executing `Disable-AzDataCollection`. + + + + Enable-AzDataCollection + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + --- Example 1: Enabling data collection for the current user --- + Enable-AzDataCollection + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azdatacollection + + + Disable-AzDataCollection + + + + + + + Enable-AzureRmAlias + Enable + AzureRmAlias + + Enables AzureRm prefix aliases for Az modules. + + + + Enables AzureRm prefix aliases for Az modules. If -Module is specified, only modules listed will have aliases enabled. Otherwise all AzureRm aliases are enabled. + + + + Enable-AzureRmAlias + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + + Local + Process + CurrentUser + LocalMachine + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Module + + Indicates which modules to enable aliases for. If none are specified, default is all modules. + + System.String[] + + System.String[] + + + None + + + PassThru + + If specified, cmdlet will return all aliases enabled + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Indicates what scope aliases should be enabled for. Default is 'Local' + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Enable-AzureRmAlias + + Enables all AzureRm prefixes for the current PowerShell session. + + + + + + -------------------------- Example 2 -------------------------- + Enable-AzureRmAlias -Module Az.Accounts -Scope CurrentUser + + Enables AzureRm aliases for the Az.Accounts module for both the current process and for the current user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/enable-azurermalias + + + + + + Get-AzAccessToken + Get + AzAccessToken + + Get raw access token. When using -ResourceUrl, please make sure the value does match current Azure environment. You may refer to the value of `(Get-AzContext).Environment`. + + + + Get access token + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + Get-AzAccessToken + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceTypeName + + Optional resource type name, supported values: AadGraph, AnalysisServices, Arm, Attestation, Batch, DataLake, KeyVault, MSGraph, OperationalInsights, ResourceManager, Storage, Synapse. Default value is Arm if not specified. + + System.String + + System.String + + + None + + + ResourceUrl + + Resource url for that you're requesting token, e.g. 'https://graph.microsoft.com/'. + + System.String + + System.String + + + None + + + TenantId + + Optional Tenant Id. Use tenant id of default context if not specified. + + System.String + + System.String + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAccessToken + + + + + + + + + + + + + + ------- Example 1 Get the access token for ARM endpoint ------- + Get-AzAccessToken + + Get access token of current account for ResourceManager endpoint + + + + + + - Example 2 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceTypeName MSGraph + + Get access token of Microsoft Graph endpoint for current account + + + + + + - Example 3 Get the access token for Microsoft Graph endpoint - + Get-AzAccessToken -ResourceUrl "https://graph.microsoft.com/" + + Get access token of Microsoft Graph endpoint for current account + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azaccesstoken + + + + + + Get-AzContext + Get + AzContext + + Gets the metadata used to authenticate Azure Resource Manager requests. + + + + The Get-AzContext cmdlet gets the current metadata used to authenticate Azure Resource Manager requests. This cmdlet gets the Active Directory account, Active Directory tenant, Azure subscription, and the targeted Azure environment. Azure Resource Manager cmdlets use these settings by default when making Azure Resource Manager requests. When the available amount of subscription exceeds the default limit of 25, some subscriptions may not show up in the results of `Get-AzContext -ListAvailable`. Please run `Connect-AzAccount -MaxContextPopulation <int>` to get more contexts. + + + + Get-AzContext + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + + System.Management.Automation.SwitchParameter + + + False + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + + System.Management.Automation.SwitchParameter + + + False + + + + Get-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ListAvailable + + List all available contexts in the current session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + The name of the context + + System.String + + System.String + + + None + + + RefreshContextFromTokenCache + + Refresh contexts from token cache + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------------ Example 1: Getting the current context ------------ + Connect-AzAccount +Get-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + In this example we are logging into our account with an Azure subscription using Connect-AzAccount, and then we are getting the context of the current session by calling Get-AzContext. + + + + + + ---------- Example 2: Listing all available contexts ---------- + Get-AzContext -ListAvailable + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... +Subscription2 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription2 AzureCloud xxxxxxxx-x... +Subscription3 (xxxxxxxx-xxxx-xxxx-xxx... test@outlook.com Subscription3 AzureCloud xxxxxxxx-x... + + In this example, all currently available contexts are displayed. The user may select one of these contexts using Select-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontext + + + Set-AzContext + + + + Connect-AzAccount + + + + + + + Get-AzContextAutosaveSetting + Get + AzContextAutosaveSetting + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Display metadata about the context autosave feature, including whether the context is automatically saved, and where saved context and credential information can be found. + + + + Get-AzContextAutosaveSetting + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + + + + None + + + + + + + + + + Microsoft.Azure.Commands.Common.Authentication.ContextAutosaveSettings + + + + + + + + + + + + + + ------ Get context save metadata for the current session ------ + Get-AzContextAutosaveSetting + +Mode : Process +ContextDirectory : None +ContextFile : None +CacheDirectory : None +CacheFile : None +Settings : {} + + Get details about whether and where the context is saved. In the above example, the autosave feature has been disabled. + + + + + + -------- Get context save metadata for the current user -------- + Get-AzContextAutosaveSetting -Scope CurrentUser + +Mode : CurrentUser +ContextDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +ContextFile : AzureRmContext.json +CacheDirectory : C:\Users\contoso\AppData\Roaming\Windows Azure Powershell +CacheFile : TokenCache.dat +Settings : {} + + Get details about whether and where the context is saved by default for the current user. Note that this may be different than the settings that are active in the current session. In the above example, the autosave feature has been enabled, and data is saved to the default location. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azcontextautosavesetting + + + + + + Get-AzDefault + Get + AzDefault + + Get the defaults set by the user in the current context. + + + + The Get-AzDefault cmdlet gets the Resource Group that the user has set as default in the current context. + + + + Get-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ResourceGroup + + Display Default Resource Group + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Get-AzDefault + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current defaults if there are defaults set, or returns nothing if no default is set. + + + + + + -------------------------- Example 2 -------------------------- + Get-AzDefault -ResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command returns the current default Resource Group if there is a default set, or returns nothing if no default is set. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azdefault + + + + + + Get-AzEnvironment + Get + AzEnvironment + + Get endpoints and metadata for an instance of Azure services. + + + + The Get-AzEnvironment cmdlet gets endpoints and metadata for an instance of Azure services. + + + + Get-AzEnvironment + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the Azure instance to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ---------- Example 1: Getting all Azure environments ---------- + Get-AzEnvironment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in +AzureGermanCloud https://management.microsoftazure.de/ https://login.microsoftonline.de/ Built-in +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in +AzureChinaCloud https://management.chinacloudapi.cn/ https://login.chinacloudapi.cn/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + -------- Example 2: Getting the AzureCloud environment -------- + Get-AzEnvironment -Name AzureCloud + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureCloud https://management.azure.com/ https://login.microsoftonline.com/ Built-in + + This example shows how to get the endpoints and metadata for the AzureCloud (default) environment. + + + + + + ------ Example 3: Getting the AzureChinaCloud environment ------ + Get-AzEnvironment -Name AzureChinaCloud | Format-List + +Name : AzureChinaCloud +Type : Built-in +EnableAdfsAuthentication : False +OnPremise : False +ActiveDirectoryServiceEndpointResourceId : https://management.core.chinacloudapi.cn/ +AdTenant : Common +GalleryUrl : https://gallery.azure.com/ +ManagementPortalUrl : https://go.microsoft.com/fwlink/?LinkId=301902 +ServiceManagementUrl : https://management.core.chinacloudapi.cn/ +PublishSettingsFileUrl : https://go.microsoft.com/fwlink/?LinkID=301776 +ResourceManagerUrl : https://management.chinacloudapi.cn/ +SqlDatabaseDnsSuffix : .database.chinacloudapi.cn +StorageEndpointSuffix : core.chinacloudapi.cn +ActiveDirectoryAuthority : https://login.chinacloudapi.cn/ +GraphUrl : https://graph.chinacloudapi.cn/ +GraphEndpointResourceId : https://graph.chinacloudapi.cn/ +TrafficManagerDnsSuffix : trafficmanager.cn +AzureKeyVaultDnsSuffix : vault.azure.cn +DataLakeEndpointResourceId : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : https://vault.azure.cn +ContainerRegistryEndpointSuffix : azurecr.cn +AzureOperationalInsightsEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureAnalysisServicesEndpointSuffix : asazure.chinacloudapi.cn +AnalysisServicesEndpointResourceId : https://region.asazure.chinacloudapi.cn +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : dev.azuresynapse.azure.cn +AzureSynapseAnalyticsEndpointResourceId : https://dev.azuresynapse.azure.cn + + This example shows how to get the endpoints and metadata for the AzureChinaCloud environment. + + + + + + ----- Example 4: Getting the AzureUSGovernment environment ----- + Get-AzEnvironment -Name AzureUSGovernment + +Name Resource Manager Url ActiveDirectory Authority Type +---- -------------------- ------------------------- ---- +AzureUSGovernment https://management.usgovcloudapi.net/ https://login.microsoftonline.us/ Built-in + + This example shows how to get the endpoints and metadata for the AzureUSGovernment environment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azenvironment + + + Add-AzEnvironment + + + + Remove-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Get-AzSubscription + Get + AzSubscription + + Get subscriptions that the current account can access. + + + + The Get-AzSubscription cmdlet gets the subscription ID, subscription name, and home tenant for subscriptions that the current account can access. + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + Get-AzSubscription + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + AsJob + + Run cmdlet in the background and return a Job to track progress. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + SubscriptionId + + Specifies the ID of the subscription to get. + + System.String + + System.String + + + None + + + SubscriptionName + + Specifies the name of the subscription to get. + + System.String + + System.String + + + None + + + TenantId + + Specifies the ID of the tenant that contains subscriptions to get. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + + + + + ------- Example 1: Get all subscriptions in all tenants ------- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled +Subscription3 zzzz-zzzz-zzzz-zzzz bbbb-bbbb-bbbb-bbbb Enabled + + This command gets all subscriptions in all tenants that are authorized for the current account. + + + + + + ---- Example 2: Get all subscriptions for a specific tenant ---- + Get-AzSubscription -TenantId "aaaa-aaaa-aaaa-aaaa" + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + List all subscriptions in the given tenant that are authorized for the current account. + + + + + + ---- Example 3: Get all subscriptions in the current tenant ---- + Get-AzSubscription + +Name Id TenantId State +---- -- -------- ----- +Subscription1 yyyy-yyyy-yyyy-yyyy aaaa-aaaa-aaaa-aaaa Enabled +Subscription2 xxxx-xxxx-xxxx-xxxx aaaa-aaaa-aaaa-aaaa Enabled + + This command gets all subscriptions in the current tenant that are authorized for the current user. + + + + + + Example 4: Change the current context to use a specific subscription + Get-AzSubscription -SubscriptionId "xxxx-xxxx-xxxx-xxxx" -TenantId "yyyy-yyyy-yyyy-yyyy" | Set-AzContext + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Subscription1 (xxxx-xxxx-xxxx-xxxx) azureuser@micros... Subscription1 AzureCloud yyyy-yyyy-yyyy-yyyy + + This command gets the specified subscription, and then sets the current context to use it. All subsequent cmdlets in this session use the new subscription (Contoso Subscription 1) by default. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-azsubscription + + + + + + Get-AzTenant + Get + AzTenant + + Gets tenants that are authorized for the current user. + + + + The Get-AzTenant cmdlet gets tenants authorized for the current user. + + + + Get-AzTenant + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + TenantId + + Specifies the ID of the tenant that this cmdlet gets. + + System.String + + System.String + + + None + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + + + + + + + ---------------- Example 1: Getting all tenants ---------------- + Connect-AzAccount +Get-AzTenant + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} +yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy Testhost Home testhost.onmicrosoft.com + + This example shows how to get all of the authorized tenants of an Azure account. + + + + + + ------------- Example 2: Getting a specific tenant ------------- + Connect-AzAccount +Get-AzTenant -TenantId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx + +Id Name Category Domains +-- ----------- -------- ------- +xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx Microsoft Home {test0.com, test1.com, test2.microsoft.com, test3.microsoft.com...} + + This example shows how to get a specific authorized tenant of an Azure account. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/get-aztenant + + + + + + Import-AzContext + Import + AzContext + + Loads Azure authentication information from a file. + + + + The Import-AzContext cmdlet loads authentication information from a file to set the Azure environment and context. Cmdlets that you run in the current session use this information to authenticate requests to Azure Resource Manager. + + + + Import-AzContext + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Import-AzContext + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + AzureContext + + {{Fill AzureContext Description}} + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Path + + Specifies the path to context information saved by using Save-AzContext. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ----- Example 1: Importing a context from a AzureRmProfile ----- + Import-AzContext -AzContext (Connect-AzAccount) + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example imports a context from a PSAzureProfile that is passed through to the cmdlet. + + + + + + ------- Example 2: Importing a context from a JSON file ------- + Import-AzContext -Path C:\test.json + +Account SubscriptionName TenantId Environment +------- ---------------- -------- ----------- +azureuser@contoso.com Subscription1 xxxx-xxxx-xxxx-xxxx AzureCloud + + This example selects a context from a JSON file that is passed through to the cmdlet. This JSON file can be created from Save-AzContext. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/import-azcontext + + + + + + Invoke-AzRestMethod + Invoke + AzRestMethod + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Construct and perform HTTP request to Azure resource management endpoint only + + + + Invoke-AzRestMethod + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Invoke-AzRestMethod + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + AsJob + + Run cmdlet in the background + + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + + GET + POST + PUT + PATCH + DELETE + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ApiVersion + + Api Version + + System.String + + System.String + + + None + + + AsJob + + Run cmdlet in the background + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Method + + Http Method + + System.String + + System.String + + + None + + + Name + + list of Target Resource Name + + System.String[] + + System.String[] + + + None + + + Path + + Path of target resource URL. Hostname of Resource Manager should not be added. + + System.String + + System.String + + + None + + + Payload + + JSON format payload + + System.String + + System.String + + + None + + + ResourceGroupName + + Target Resource Group Name + + System.String + + System.String + + + None + + + ResourceId + + Identifier URI specified by the REST API you are calling. It shouldn't be the resource id of Azure Resource Manager. + + System.Uri + + System.Uri + + + None + + + ResourceProviderName + + Target Resource Provider Name + + System.String + + System.String + + + None + + + ResourceType + + List of Target Resource Type + + System.String[] + + System.String[] + + + None + + + SubscriptionId + + Target Subscription Id + + System.String + + System.String + + + None + + + Uri + + Uniform Resource Identifier of the Azure resources. The target resource needs to support Azure AD authentication and the access token is derived according to resource id. If resource id is not set, its value is derived according to built-in service suffixes in current Azure Environment. + + System.Uri + + System.Uri + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.string + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSHttpResponse + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Invoke-AzRestMethod -Path "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}?api-version={API}" -Method GET + +Headers : {[Cache-Control, System.String[]], [Pragma, System.String[]], [x-ms-request-id, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : { + "properties": { + "source": "Azure", + "customerId": "{customerId}", + "provisioningState": "Succeeded", + "sku": { + "name": "pergb2018", + "maxCapacityReservationLevel": 3000, + "lastSkuUpdate": "Mon, 25 May 2020 11:10:01 GMT" + }, + "retentionInDays": 30, + "features": { + "legacy": 0, + "searchVersion": 1, + "enableLogAccessUsingOnlyResourcePermissions": true + }, + "workspaceCapping": { + "dailyQuotaGb": -1.0, + "quotaNextResetTime": "Thu, 18 Jun 2020 05:00:00 GMT", + "dataIngestionStatus": "RespectQuota" + }, + "enableFailover": false, + "publicNetworkAccessForIngestion": "Enabled", + "publicNetworkAccessForQuery": "Enabled", + "createdDate": "Mon, 25 May 2020 11:10:01 GMT", + "modifiedDate": "Mon, 25 May 2020 11:10:02 GMT" + }, + "id": "/subscriptions/{subscription}/resourcegroups/{resourcegroup}/providers/microsoft.operationalinsights/workspaces/{workspace}", + "name": "{workspace}", + "type": "Microsoft.OperationalInsights/workspaces", + "location": "eastasia", + "tags": {} + } + + Get log analytics workspace by path. It only supports management plane API and Hostname of Azure Resource Manager is added according to Azure environment setting. + + + + + + + -------------------------- Example 2 -------------------------- + Invoke-AzRestMethod https://graph.microsoft.com/v1.0/me + +Headers : {[Date, System.String[]], [Cache-Control, System.String[]], [Transfer-Encoding, System.String[]], [Strict-Transport-Security, System.String[]]…} +Version : 1.1 +StatusCode : 200 +Method : GET +Content : {"@odata.context":"https://graph.microsoft.com/v1.0/$metadata#users/$entity","businessPhones":["......} + + Get current signed in user via MicrosoftGraph API. This example is equivalent to `Get-AzADUser -SignedIn`. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/invoke-azrestmethod + + + + + + Open-AzSurveyLink + Open + AzSurveyLink + + Open survey link in default browser. + + + + Open survey link in default browser. + + + + Open-AzSurveyLink + + + + + + + None + + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Open-AzSurveyLink + +Opening the default browser to https://aka.ms/azpssurvey?Q_CHL=INTERCEPT + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/open-azsurveylink + + + + + + Register-AzModule + Register + AzModule + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + FOR INTERNAL USE ONLY - Provide Runtime Support for AutoRest Generated cmdlets + + + + Register-AzModule + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.Object + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Register-AzModule + + Used Internally by AutoRest-generated cmdlets + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/register-azmodule + + + + + + Remove-AzContext + Remove + AzContext + + Remove a context from the set of available contexts + + + + Remove an azure context from the set of contexts + + + + Remove-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Remove-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the removed context + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Remove context even if it is the default + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + PassThru + + Return the removed context + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Remove-AzContext -Name Default + + Remove the context named default + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azcontext + + + + + + Remove-AzEnvironment + Remove + AzEnvironment + + Removes endpoints and metadata for connecting to a given Azure instance. + + + + The Remove-AzEnvironment cmdlet removes endpoints and metadata information for connecting to a given Azure instance. + + + + Remove-AzEnvironment + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Name + + Specifies the name of the environment to remove. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and removing a test environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Remove-AzEnvironment -Name TestEnvironment + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + + This example shows how to create an environment using Add-AzEnvironment, and then how to delete the environment using Remove-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/remove-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Set-AzEnvironment + + + + + + + Rename-AzContext + Rename + AzContext + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename an Azure context. By default contexts are named by user account and subscription. + + + + Rename-AzContext + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Rename-AzContext + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + + System.Management.Automation.SwitchParameter + + + False + + + PassThru + + Return the renamed context. + + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Rename the context even if the target context already exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + PassThru + + Return the renamed context. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + SourceName + + The name of the context + + System.String + + System.String + + + None + + + TargetName + + The new name of the context + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ------ Example 1: Rename a context using named parameters ------ + Rename-AzContext -SourceName "[user1@contoso.org; 12345-6789-2345-3567890]" -TargetName "Work" + + Rename the context for 'user1@contoso.org' with subscription '12345-6789-2345-3567890' to 'Work'. After this command, you will be able to target the context using 'Select-AzContext Work'. Note that you can tab through the values for 'SourceName' using tab completion. + + + + + + --- Example 2: Rename a context using positional parameters --- + Rename-AzContext "My context" "Work" + + Rename the context named "My context" to "Work". After this command, you will be able to target the context using Select-AzContext Work + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/rename-azcontext + + + + + + Resolve-AzError + Resolve + AzError + + Display detailed information about PowerShell errors, with extended details for Azure PowerShell errors. + + + + Resolves and displays detailed information about errors in the current PowerShell session, including where the error occurred in script, stack trace, and all inner and aggregate exceptions. For Azure PowerShell errors provides additional detail in debugging service issues, including complete detail about the request and server response that caused the error. + + + + Resolve-AzError + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + Resolve-AzError + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Last + + Resolve only the last error that occurred in the session. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Error + + One or more error records to resolve. If no parameters are specified, all errors in the session are resolved. + + System.Management.Automation.ErrorRecord[] + + System.Management.Automation.ErrorRecord[] + + + None + + + Last + + Resolve only the last error that occurred in the session. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.Management.Automation.ErrorRecord[] + + + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureErrorRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureExceptionRecord + + + + + + + + Microsoft.Azure.Commands.Profile.Errors.AzureRestExceptionRecord + + + + + + + + + + + + + + -------------- Example 1: Resolve the Last Error -------------- + Resolve-AzError -Last + +HistoryId: 3 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in AzureRmCmdlet.cs:line 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() inAzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 3 + + Get details of the last error. + + + + + + --------- Example 2: Resolve all Errors in the Session --------- + Resolve-AzError + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + + HistoryId: 5 + + +Message : Run Connect-AzAccount to login. +StackTrace : at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.get_DefaultContext() in C:\zd\azur + e-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 85 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.LogCmdletStartInvocationInfo() in + C:\zd\azure-powershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:lin + e 269 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.BeginProcessing() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 299 + at Microsoft.Azure.Commands.ResourceManager.Common.AzureRMCmdlet.BeginProcessing() in C:\zd\azure-p + owershell\src\ResourceManager\Common\Commands.ResourceManager.Common\AzureRmCmdlet.cs:line 320 + at Microsoft.Azure.Commands.Profile.GetAzureRMSubscriptionCommand.BeginProcessing() in C:\zd\azure- + powershell\src\ResourceManager\Profile\Commands.Profile\Subscription\GetAzureRMSubscription.cs:line 49 + at System.Management.Automation.Cmdlet.DoBeginProcessing() + at System.Management.Automation.CommandProcessorBase.DoBegin() +Exception : System.Management.Automation.PSInvalidOperationException +InvocationInfo : {Get-AzSubscription} +Line : Get-AzSubscription +Position : At line:1 char:1 + + Get-AzSubscription + + ~~~~~~~~~~~~~~~~~~~~~~~ +HistoryId : 5 + + Get details of all errors that have occurred in the current session. + + + + + + ------------- Example 3: Resolve a Specific Error ------------- + Resolve-AzError $Error[0] + +HistoryId: 8 + + +RequestId : b61309e8-09c9-4f0d-ba56-08a6b28c731d +Message : Resource group 'contoso' could not be found. +ServerMessage : ResourceGroupNotFound: Resource group 'contoso' could not be found. + (System.Collections.Generic.List`1[Microsoft.Rest.Azure.CloudError]) +ServerResponse : {NotFound} +RequestMessage : {GET https://management.azure.com/subscriptions/00977cdb-163f-435f-9c32-39ec8ae61f4d/resourceGroups/co + ntoso/providers/Microsoft.Storage/storageAccounts/contoso?api-version=2016-12-01} +InvocationInfo : {Get-AzStorageAccount} +Line : Get-AzStorageAccount -ResourceGroupName contoso -Name contoso +Position : At line:1 char:1 + + Get-AzStorageAccount -ResourceGroupName contoso -Name contoso + + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +StackTrace : at Microsoft.Azure.Management.Storage.StorageAccountsOperations.<GetPropertiesWithHttpMessagesAsync + >d__8.MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.<GetPropertiesAsync>d__7. + MoveNext() + --- End of stack trace from previous location where exception was thrown --- + at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() + at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) + at Microsoft.Azure.Management.Storage.StorageAccountsOperationsExtensions.GetProperties(IStorageAcc + ountsOperations operations, String resourceGroupName, String accountName) + at Microsoft.Azure.Commands.Management.Storage.GetAzureStorageAccountCommand.ExecuteCmdlet() in C:\ + zd\azure-powershell\src\ResourceManager\Storage\Commands.Management.Storage\StorageAccount\GetAzureSto + rageAccount.cs:line 70 + at Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet.ProcessRecord() in + C:\zd\azure-powershell\src\Common\Commands.Common\AzurePSCmdlet.cs:line 642 +HistoryId : 8 + + Get details of the specified error. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/resolve-azerror + + + + + + Save-AzContext + Save + AzContext + + Saves the current authentication information for use in other PowerShell sessions. + + + + The Save-AzContext cmdlet saves the current authentication information for use in other PowerShell sessions. + + + + Save-AzContext + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Overwrite the given file if it exists + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Path + + Specifies the path of the file to which to save authentication information. + + System.String + + System.String + + + None + + + Profile + + Specifies the Azure context from which this cmdlet reads. If you do not specify a context, this cmdlet reads from the local default context. + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Common.Authentication.Models.AzureRmProfile + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureProfile + + + + + + + + + + + + + + ------- Example 1: Saving the current session's context ------- + Connect-AzAccount +Save-AzContext -Path C:\test.json + + This example saves the current session's Azure context to the JSON file provided. + + + + + + -------------- Example 2: Saving a given context -------------- + Save-AzContext -Profile (Connect-AzAccount) -Path C:\test.json + + This example saves the Azure context that is passed through to the cmdlet to the JSON file provided. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/save-azcontext + + + + + + Select-AzContext + Select + AzContext + + Select a subscription and account to target in Azure PowerShell cmdlets + + + + Select a subscription to target (or account or tenant) in Azure PowerShell cmdlets. After this cmdlet, future cmdlets will target the selected context. + + + + Select-AzContext + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Select-AzContext + + Name + + The name of the context + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, tenant and subscription used for communication with azure + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + InputObject + + A context object, normally passed through the pipeline. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + Name + + The name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + -------------- Example 1: Target a named context -------------- + Select-AzContext "Work" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + Target future Azure PowerShell cmdlets at the account, tenant, and subscription in the 'Work' context. + + + + + + -------------------------- Example 2 -------------------------- + <!-- Aladdin Generated Example --> +Select-AzContext -Name TestEnvironment -Scope Process + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/select-azcontext + + + + + + Send-Feedback + Send + Feedback + + Sends feedback to the Azure PowerShell team via a set of guided prompts. + + + + The Send-Feedback cmdlet sends feedback to the Azure PowerShell team. + + + + Send-Feedback + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + + + + None + + + + + + + + + + System.Void + + + + + + + + + + + + + + -------------------------- Example 1: -------------------------- + Send-Feedback + +With zero (0) being the least and ten (10) being the most, how likely are you to recommend Azure PowerShell to a friend or colleague? + +10 + +What does Azure PowerShell do well? + +Response. + +Upon what could Azure PowerShell improve? + +Response. + +Please enter your email if you are interested in providing follow up information: + +your@email.com + + + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/send-feedback + + + + + + Set-AzContext + Set + AzContext + + Sets the tenant, subscription, and environment for cmdlets to use in the current session. + + + + The Set-AzContext cmdlet sets authentication information for cmdlets that you run in the current session. The context includes tenant, subscription, and environment information. + + + + Set-AzContext + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzContext + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + Context + + Specifies the context for the current session. + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + None + + + DefaultProfile + + The credentials, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + ExtendedProperty + + Additional context properties + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + System.Collections.Generic.IDictionary`2[System.String,System.String] + + + None + + + Force + + Overwrite the existing context with the same name, if any. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Name + + Name of the context + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Subscription + + The name or id of the subscription that the context should be set to. This parameter has aliases to -SubscriptionName and -SubscriptionId, so, for clarity, either of these can be used instead of -Subscription when specifying name and id, respectively. + + System.String + + System.String + + + None + + + SubscriptionObject + + A subscription object + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + None + + + Tenant + + Tenant domain name or ID + + System.String + + System.String + + + None + + + TenantObject + + A Tenant Object + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureTenant + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureSubscription + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.Core.PSAzureContext + + + + + + + + + + + + + + ----------- Example 1: Set the subscription context ----------- + Set-AzContext -Subscription "xxxx-xxxx-xxxx-xxxx" + +Name Account SubscriptionName Environment TenantId +---- ------- ---------------- ----------- -------- +Work test@outlook.com Subscription1 AzureCloud xxxxxxxx-x... + + This command sets the context to use the specified subscription. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azcontext + + + Get-AzContext + + + + + + + Set-AzDefault + Set + AzDefault + + Sets a default in the current context + + + + The Set-AzDefault cmdlet adds or changes the defaults in the current context. + + + + Set-AzDefault + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Force + + Create a new resource group if specified default does not exist + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + ResourceGroupName + + Name of the resource group being set as default + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSResourceGroup + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Set-AzDefault -ResourceGroupName myResourceGroup + +Id : /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourceGroups/myResourceGroup +Name : myResourceGroup +Properties : Microsoft.Azure.Management.Internal.Resources.Models.ResourceGroupProperties +Location : eastus +ManagedBy : +Tags : + + This command sets the default resource group to the resource group specified by the user. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azdefault + + + + + + Set-AzEnvironment + Set + AzEnvironment + + Sets properties for an Azure environment. + + + + The Set-AzEnvironment cmdlet sets endpoints and metadata for connecting to an instance of Azure. + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + + System.Management.Automation.SwitchParameter + + + False + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + Set-AzEnvironment + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + + Process + CurrentUser + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + ActiveDirectoryEndpoint + + Specifies the base authority for Azure Active Directory authentication. + + System.String + + System.String + + + None + + + ActiveDirectoryServiceEndpointResourceId + + Specifies the audience for tokens that authenticate requests to Azure Resource Manager or Service Management (RDFE) endpoints. + + System.String + + System.String + + + None + + + AdTenant + + Specifies the default Active Directory tenant. + + System.String + + System.String + + + None + + + ARMEndpoint + + The Azure Resource Manager endpoint. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointResourceId + + The resource identifier of the Azure Analysis Services resource. + + System.String + + System.String + + + None + + + AzureAnalysisServicesEndpointSuffix + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointResourceId + + The The resource identifier of the Azure Attestation service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureAttestationServiceEndpointSuffix + + Dns suffix of Azure Attestation service. + + System.String + + System.String + + + None + + + AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix + + Dns Suffix of Azure Data Lake Analytics job and catalog services + + System.String + + System.String + + + None + + + AzureDataLakeStoreFileSystemEndpointSuffix + + Dns Suffix of Azure Data Lake Store FileSystem. Example: azuredatalake.net + + System.String + + System.String + + + None + + + AzureKeyVaultDnsSuffix + + Dns suffix of Azure Key Vault service. Example is vault-int.azure-int.net + + System.String + + System.String + + + None + + + AzureKeyVaultServiceEndpointResourceId + + Resource identifier of Azure Key Vault data service that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpoint + + The endpoint to use when communicating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureOperationalInsightsEndpointResourceId + + The audience for tokens authenticating with the Azure Log Analytics API. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointResourceId + + The The resource identifier of the Azure Synapse Analytics that is the recipient of the requested token. + + System.String + + System.String + + + None + + + AzureSynapseAnalyticsEndpointSuffix + + Dns suffix of Azure Synapse Analytics. + + System.String + + System.String + + + None + + + BatchEndpointResourceId + + The resource identifier of the Azure Batch service that is the recipient of the requested token + + System.String + + System.String + + + None + + + ContainerRegistryEndpointSuffix + + Suffix of Azure Container Registry. + + System.String + + System.String + + + None + + + DataLakeAudience + + The audience for tokens authenticating with the AD Data Lake services Endpoint. + + System.String + + System.String + + + None + + + DefaultProfile + + The credentials, account, tenant and subscription used for communication with azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + EnableAdfsAuthentication + + Indicates that Active Directory Federation Services (ADFS) on-premise authentication is allowed. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + GalleryEndpoint + + Specifies the endpoint for the Azure Resource Manager gallery of deployment templates. + + System.String + + System.String + + + None + + + GraphAudience + + The audience for tokens authenticating with the AD Graph Endpoint. + + System.String + + System.String + + + None + + + GraphEndpoint + + Specifies the URL for Graph (Active Directory metadata) requests. + + System.String + + System.String + + + None + + + ManagementPortalUrl + + Specifies the URL for the Management Portal. + + System.String + + System.String + + + None + + + MicrosoftGraphEndpointResourceId + + The resource identifier of Microsoft Graph + + System.String + + System.String + + + None + + + MicrosoftGraphUrl + + Microsoft Graph Url + + System.String + + System.String + + + None + + + Name + + Specifies the name of the environment to modify. + + System.String + + System.String + + + None + + + PublishSettingsFileUrl + + Specifies the URL from which .publishsettings files can be downloaded. + + System.String + + System.String + + + None + + + ResourceManagerEndpoint + + Specifies the URL for Azure Resource Manager requests. + + System.String + + System.String + + + None + + + Scope + + Determines the scope of context changes, for example, whether changes apply only to the current process, or to all sessions started by this user. + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + Microsoft.Azure.Commands.Profile.Common.ContextModificationScope + + + None + + + ServiceEndpoint + + Specifies the endpoint for Service Management (RDFE) requests. + + System.String + + System.String + + + None + + + SqlDatabaseDnsSuffix + + Specifies the domain-name suffix for Azure SQL Database servers. + + System.String + + System.String + + + None + + + StorageEndpoint + + Specifies the endpoint for storage (blob, table, queue, and file) access. + + System.String + + System.String + + + None + + + TrafficManagerDnsSuffix + + Specifies the domain-name suffix for Azure Traffic Manager services. + + System.String + + System.String + + + None + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + System.String + + + + + + + + System.Management.Automation.SwitchParameter + + + + + + + + + + Microsoft.Azure.Commands.Profile.Models.PSAzureEnvironment + + + + + + + + + + + + + + ----- Example 1: Creating and modifying a new environment ----- + Add-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint TestADEndpoint ` + -ActiveDirectoryServiceEndpointResourceId TestADApplicationId ` + -ResourceManagerEndpoint TestRMEndpoint ` + -GalleryEndpoint TestGalleryEndpoint ` + -GraphEndpoint TestGraphEndpoint + +Name Resource Manager Url ActiveDirectory Authority +---- -------------------- ------------------------- +TestEnvironment TestRMEndpoint TestADEndpoint/ + +Set-AzEnvironment -Name TestEnvironment ` + -ActiveDirectoryEndpoint NewTestADEndpoint ` + -GraphEndpoint NewTestGraphEndpoint | Format-List + +Name : TestEnvironment +EnableAdfsAuthentication : False +ActiveDirectoryServiceEndpointResourceId : TestADApplicationId +AdTenant : +GalleryUrl : TestGalleryEndpoint +ManagementPortalUrl : +ServiceManagementUrl : +PublishSettingsFileUrl : +ResourceManagerUrl : TestRMEndpoint +SqlDatabaseDnsSuffix : +StorageEndpointSuffix : +ActiveDirectoryAuthority : NewTestADEndpoint +GraphUrl : NewTestGraphEndpoint +GraphEndpointResourceId : +TrafficManagerDnsSuffix : +AzureKeyVaultDnsSuffix : +AzureDataLakeStoreFileSystemEndpointSuffix : +AzureDataLakeAnalyticsCatalogAndJobEndpointSuffix : +AzureKeyVaultServiceEndpointResourceId : +BatchEndpointResourceId : +AzureOperationalInsightsEndpoint : +AzureOperationalInsightsEndpointResourceId : +AzureAttestationServiceEndpointSuffix : +AzureAttestationServiceEndpointResourceId : +AzureSynapseAnalyticsEndpointSuffix : +AzureSynapseAnalyticsEndpointResourceId : + + In this example we are creating a new Azure environment with sample endpoints using Add-AzEnvironment, and then we are changing the value of the ActiveDirectoryEndpoint and GraphEndpoint attributes of the created environment using the cmdlet Set-AzEnvironment. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/set-azenvironment + + + Add-AzEnvironment + + + + Get-AzEnvironment + + + + Remove-AzEnvironment + + + + + + + Uninstall-AzureRm + Uninstall + AzureRm + + Removes all AzureRm modules from a machine. + + + + Removes all AzureRm modules from a machine. + + + + Uninstall-AzureRm + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + + System.Management.Automation.SwitchParameter + + + False + + + + + + DefaultProfile + + The credentials, account, tenant, and subscription used for communication with Azure. + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer + + + None + + + PassThru + + Return list of Modules removed if specified. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + Confirm + + Prompts you for confirmation before running the cmdlet. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + WhatIf + + Shows what would happen if the cmdlet runs. The cmdlet is not run. + + System.Management.Automation.SwitchParameter + + System.Management.Automation.SwitchParameter + + + False + + + + + + None + + + + + + + + + + System.String + + + + + + + + + + + + + + -------------------------- Example 1 -------------------------- + Uninstall-AzureRm + + Running this command will remove all AzureRm modules from the machine for the version of PowerShell in which the cmdlet is run. + + + + + + + + Online Version: + https://docs.microsoft.com/powershell/module/az.accounts/uninstall-azurerm + + + + \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll new file mode 100644 index 000000000000..e45ac91a1264 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.Share.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll new file mode 100644 index 000000000000..a705c3fd25a8 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Common.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll new file mode 100644 index 000000000000..f15127c61779 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Storage.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll new file mode 100644 index 000000000000..f82770a9ceed Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Azure.PowerShell.Strategies.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll new file mode 100644 index 000000000000..1d99c7015912 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.Azure.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll new file mode 100644 index 000000000000..4b4be00999a4 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.Rest.ClientRuntime.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll new file mode 100644 index 000000000000..6ac672abd486 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.DataMovement.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll new file mode 100644 index 000000000000..70c5ed6806c6 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/Microsoft.WindowsAzure.Storage.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 new file mode 100644 index 000000000000..bb0bc9e63f5d --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PostImportScripts/LoadAuthenticators.ps1 @@ -0,0 +1,219 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } catch {} +} +# SIG # Begin signature block +# MIInugYJKoZIhvcNAQcCoIInqzCCJ6cCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCBn8ROze2QLH/c6 +# GtPhR/BPLgOtmjkNhcq+fFmu16VcrqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjzCCGYsCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgLwxfLTEa +# f5cZ43nGFJSGxV1AZMu24c5Ln5TdSBDWTncwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCH+MB7uS3RlpbV8q8Nvg9aa0UmWWYCFOT/3n7V09Q6 +# p3v/uFdZ8AXCe8zdAeWFwLOQg9974QcDbIbvXm1V96+Z7zEEimU/Zr1ou5Cv0knI +# riaKdejplgnDt1EnBE9JlSyVsV7aOYr4EueMCb1Xn1dfGabKcgVlJUlP0JyZPQfs +# YqsyxEznkgNE769m8ozUwCx33jJN1Llcs3FYEe5irzu8UthSkFQ8vpG3YABhlk6M +# 4jPeb38LKbkEE0jclq6sfdmT+JL8j7Z05KfgaD076LnpSaqkcu9+2RH3TARosqhq +# I/N3nhDQclKIl1kYSXFG1E4/6ea3rAa98adIaR0YNcpFoYIXGTCCFxUGCisGAQQB +# gjcDAwExghcFMIIXAQYJKoZIhvcNAQcCoIIW8jCCFu4CAQMxDzANBglghkgBZQME +# AgEFADCCAVkGCyqGSIb3DQEJEAEEoIIBSASCAUQwggFAAgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIDsI/xX4lqk74CTV97lUQ0iyAOiIu4ggTwVzbGvl +# +HKeAgZiMTFcH0UYEzIwMjIwMzMxMTAwMDA5LjQ1OVowBIACAfSggdikgdUwgdIx +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1p +# Y3Jvc29mdCBJcmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhh +# bGVzIFRTUyBFU046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBU +# aW1lLVN0YW1wIFNlcnZpY2WgghFoMIIHFDCCBPygAwIBAgITMwAAAY16VS54dJkq +# twABAAABjTANBgkqhkiG9w0BAQsFADB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0Eg +# MjAxMDAeFw0yMTEwMjgxOTI3NDVaFw0yMzAxMjYxOTI3NDVaMIHSMQswCQYDVQQG +# EwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwG +# A1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMS0wKwYDVQQLEyRNaWNyb3NvZnQg +# SXJlbGFuZCBPcGVyYXRpb25zIExpbWl0ZWQxJjAkBgNVBAsTHVRoYWxlcyBUU1Mg +# RVNOOkEyNDAtNEI4Mi0xMzBFMSUwIwYDVQQDExxNaWNyb3NvZnQgVGltZS1TdGFt +# cCBTZXJ2aWNlMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA2jRILZg+ +# O6U7dLcuwBPMB+0tJUz0wHLqJ5f7KJXQsTzWToADUMYV4xVZnp9mPTWojUJ/l3O4 +# XqegLDNduFAObcitrLyY5HDsxAfUG1/2YilcSkSP6CcMqWfsSwULGX5zlsVKHJ7t +# vwg26y6eLklUdFMpiq294T4uJQdXd5O7mFy0vVkaGPGxNWLbZxKNzqKtFnWQ7jMt +# Z05XvafkIWZrNTFv8GGpAlHtRsZ1A8KDo6IDSGVNZZXbQs+fOwMOGp/Bzod8f1YI +# 8Gb2oN/mx2ccvdGr9la55QZeVsM7LfTaEPQxbgAcLgWDlIPcmTzcBksEzLOQsSpB +# zsqPaWI9ykVw5ofmrkFKMbpQT5EMki2suJoVM5xGgdZWnt/tz00xubPSKFi4B4IM +# FUB9mcANUq9cHaLsHbDJ+AUsVO0qnVjwzXPYJeR7C/B8X0Ul6UkIdplZmncQZSBK +# 3yZQy+oGsuJKXFAq3BlxT6kDuhYYvO7itLrPeY0knut1rKkxom+ui6vCdthCfnAi +# yknyRC2lknqzz8x1mDkQ5Q6Ox9p6/lduFupSJMtgsCPN9fIvrfppMDFIvRoULsHO +# dLJjrRli8co5M+vZmf20oTxYuXzM0tbRurEJycB5ZMbwznsFHymOkgyx8OeFnXV3 +# car45uejI1B1iqUDbeSNxnvczuOhcpzwackCAwEAAaOCATYwggEyMB0GA1UdDgQW +# BBR4zJFuh59GwpTuSju4STcflihmkzAfBgNVHSMEGDAWgBSfpxVdAF5iXYP05dJl +# pxtTNRnpcjBfBgNVHR8EWDBWMFSgUqBQhk5odHRwOi8vd3d3Lm1pY3Jvc29mdC5j +# b20vcGtpb3BzL2NybC9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENBJTIwMjAx +# MCgxKS5jcmwwbAYIKwYBBQUHAQEEYDBeMFwGCCsGAQUFBzAChlBodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY3Jvc29mdCUyMFRpbWUtU3Rh +# bXAlMjBQQ0ElMjAyMDEwKDEpLmNydDAMBgNVHRMBAf8EAjAAMBMGA1UdJQQMMAoG +# CCsGAQUFBwMIMA0GCSqGSIb3DQEBCwUAA4ICAQA1r3Oz0lEq3VvpdFlh3YBxc4hn +# YkALyYPDa9FO4XgqwkBm8Lsb+lK3tbGGgpi6QJbK3iM3BK0ObBcwRaJVCxGLGtr6 +# Jz9hRumRyF8o4n2y3YiKv4olBxNjFShSGc9E29JmVjBmLgmfjRqPc/2rD25q4ow4 +# uA3rc9ekiaufgGhcSAdek/l+kASbzohOt/5z2+IlgT4e3auSUzt2GAKfKZB02ZDG +# WKKeCY3pELj1tuh6yfrOJPPInO4ZZLW3vgKavtL8e6FJZyJoDFMewJ59oEL+AK3e +# 2M2I4IFE9n6LVS8bS9UbMUMvrAlXN5ZM2I8GdHB9TbfI17Wm/9Uf4qu588PJN7vC +# Jj9s+KxZqXc5sGScLgqiPqIbbNTE+/AEZ/eTixc9YLgTyMqakZI59wGqjrONQSY7 +# u0VEDkEE6ikz+FSFRKKzpySb0WTgMvWxsLvbnN8ACmISPnBHYZoGssPAL7foGGKF +# LdABTQC2PX19WjrfyrshHdiqSlCspqIGBTxRaHtyPMro3B/26gPfCl3MC3rC3NGq +# 4xGnIHDZGSizUmGg8TkQAloVdU5dJ1v910gjxaxaUraGhP8IttE0RWnU5XRp/sGa +# NmDcMwbyHuSpaFsn3Q21OzitP4BnN5tprHangAC7joe4zmLnmRnAiUc9sRqQ2bms +# MAvUpsO8nlOFmiM1LzCCB3EwggVZoAMCAQICEzMAAAAVxedrngKbSZkAAAAAABUw +# DQYJKoZIhvcNAQELBQAwgYgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xMjAwBgNVBAMTKU1pY3Jvc29mdCBSb290IENlcnRpZmljYXRlIEF1dGhv +# cml0eSAyMDEwMB4XDTIxMDkzMDE4MjIyNVoXDTMwMDkzMDE4MzIyNVowfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +# ggIKAoICAQDk4aZM57RyIQt5osvXJHm9DtWC0/3unAcH0qlsTnXIyjVX9gF/bErg +# 4r25PhdgM/9cT8dm95VTcVrifkpa/rg2Z4VGIwy1jRPPdzLAEBjoYH1qUoNEt6aO +# RmsHFPPFdvWGUNzBRMhxXFExN6AKOG6N7dcP2CZTfDlhAnrEqv1yaa8dq6z2Nr41 +# JmTamDu6GnszrYBbfowQHJ1S/rboYiXcag/PXfT+jlPP1uyFVk3v3byNpOORj7I5 +# LFGc6XBpDco2LXCOMcg1KL3jtIckw+DJj361VI/c+gVVmG1oO5pGve2krnopN6zL +# 64NF50ZuyjLVwIYwXE8s4mKyzbnijYjklqwBSru+cakXW2dg3viSkR4dPf0gz3N9 +# QZpGdc3EXzTdEonW/aUgfX782Z5F37ZyL9t9X4C626p+Nuw2TPYrbqgSUei/BQOj +# 0XOmTTd0lBw0gg/wEPK3Rxjtp+iZfD9M269ewvPV2HM9Q07BMzlMjgK8QmguEOqE +# UUbi0b1qGFphAXPKZ6Je1yh2AuIzGHLXpyDwwvoSCtdjbwzJNmSLW6CmgyFdXzB0 +# kZSU2LlQ+QuJYfM2BjUYhEfb3BvR/bLUHMVr9lxSUV0S2yW6r1AFemzFER1y7435 +# UsSFF5PAPBXbGjfHCBUYP3irRbb1Hode2o+eFnJpxq57t7c+auIurQIDAQABo4IB +# 3TCCAdkwEgYJKwYBBAGCNxUBBAUCAwEAATAjBgkrBgEEAYI3FQIEFgQUKqdS/mTE +# mr6CkTxGNSnPEP8vBO4wHQYDVR0OBBYEFJ+nFV0AXmJdg/Tl0mWnG1M1GelyMFwG +# A1UdIARVMFMwUQYMKwYBBAGCN0yDfQEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly93 +# d3cubWljcm9zb2Z0LmNvbS9wa2lvcHMvRG9jcy9SZXBvc2l0b3J5Lmh0bTATBgNV +# HSUEDDAKBggrBgEFBQcDCDAZBgkrBgEEAYI3FAIEDB4KAFMAdQBiAEMAQTALBgNV +# HQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBTV9lbLj+iiXGJo +# 0T2UkFvXzpoYxDBWBgNVHR8ETzBNMEugSaBHhkVodHRwOi8vY3JsLm1pY3Jvc29m +# dC5jb20vcGtpL2NybC9wcm9kdWN0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5j +# cmwwWgYIKwYBBQUHAQEETjBMMEoGCCsGAQUFBzAChj5odHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNydDAN +# BgkqhkiG9w0BAQsFAAOCAgEAnVV9/Cqt4SwfZwExJFvhnnJL/Klv6lwUtj5OR2R4 +# sQaTlz0xM7U518JxNj/aZGx80HU5bbsPMeTCj/ts0aGUGCLu6WZnOlNN3Zi6th54 +# 2DYunKmCVgADsAW+iehp4LoJ7nvfam++Kctu2D9IdQHZGN5tggz1bSNU5HhTdSRX +# ud2f8449xvNo32X2pFaq95W2KFUn0CS9QKC/GbYSEhFdPSfgQJY4rPf5KYnDvBew +# VIVCs/wMnosZiefwC2qBwoEZQhlSdYo2wh3DYXMuLGt7bj8sCXgU6ZGyqVvfSaN0 +# DLzskYDSPeZKPmY7T7uG+jIa2Zb0j/aRAfbOxnT99kxybxCrdTDFNLB62FD+Cljd +# QDzHVG2dY3RILLFORy3BFARxv2T5JL5zbcqOCb2zAVdJVGTZc9d/HltEAY5aGZFr +# DZ+kKNxnGSgkujhLmm77IVRrakURR6nxt67I6IleT53S0Ex2tVdUCbFpAUR+fKFh +# bHP+CrvsQWY9af3LwUFJfn6Tvsv4O+S3Fb+0zj6lMVGEvL8CwYKiexcdFYmNcP7n +# tdAoGokLjzbaukz5m/8K6TT4JDVnK+ANuOaMmdbhIurwJ0I9JZTmdHRbatGePu1+ +# oDEzfbzL6Xu/OHBE0ZDxyKs6ijoIYn/ZcGNTTY3ugm2lBRDBcQZqELQdVTNYs6Fw +# ZvKhggLXMIICQAIBATCCAQChgdikgdUwgdIxCzAJBgNVBAYTAlVTMRMwEQYDVQQI +# EwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3Nv +# ZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJcmVsYW5kIE9wZXJh +# dGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBFU046QTI0MC00Qjgy +# LTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1wIFNlcnZpY2WiIwoB +# ATAHBgUrDgMCGgMVAIBzlZM9TRND4PgtpLWQZkSPYVcJoIGDMIGApH4wfDELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9z +# b2Z0IFRpbWUtU3RhbXAgUENBIDIwMTAwDQYJKoZIhvcNAQEFBQACBQDl73XWMCIY +# DzIwMjIwMzMxMDgzNTM0WhgPMjAyMjA0MDEwODM1MzRaMHcwPQYKKwYBBAGEWQoE +# ATEvMC0wCgIFAOXvddYCAQAwCgIBAAICF6kCAf8wBwIBAAICER8wCgIFAOXwx1YC +# AQAwNgYKKwYBBAGEWQoEAjEoMCYwDAYKKwYBBAGEWQoDAqAKMAgCAQACAwehIKEK +# MAgCAQACAwGGoDANBgkqhkiG9w0BAQUFAAOBgQAY60kde7HWABLbM75dgVqLPwu2 +# UX3qQDaoStTqkS7953pYHKc6GEqRd/nLCCeYBqC+XJRMTMNbd4ZDkkCzsxlr5HFi +# GE6eT7+KvwqQf+djK59ZAts0no9RPZcdCJwQfvqU3RK91gp/Sg2bCMvAfTN4LRGp +# qQ4tYYP2GrJJNqVbkDGCBA0wggQJAgEBMIGTMHwxCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3AAEAAAGNMA0GCWCGSAFlAwQCAQUAoIIB +# SjAaBgkqhkiG9w0BCQMxDQYLKoZIhvcNAQkQAQQwLwYJKoZIhvcNAQkEMSIEIOQz +# W64DlGXuO2zRgqB/n+gyoReL9ldfVdiKRVTSCDK+MIH6BgsqhkiG9w0BCRACLzGB +# 6jCB5zCB5DCBvQQgnpYRM/odXkDAnzf2udL569W8cfGTgwVuenQ8ttIYzX8wgZgw +# gYCkfjB8MQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UE +# BxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYD +# VQQDEx1NaWNyb3NvZnQgVGltZS1TdGFtcCBQQ0EgMjAxMAITMwAAAY16VS54dJkq +# twABAAABjTAiBCCgvCueU3dRfCsOKSpG5oksOx2/8SHFEjSLBygedl9oUzANBgkq +# hkiG9w0BAQsFAASCAgASDKu2OAv74hH075B2jN90FtXMtuST3zF61GC5OXm38b4j +# NSjLjbMslJJqeXiyODEQFNxmdE9AgPguQK13CeNnqsx2krlMfIC4o+M2pN7lqWCk +# gWfp5QemsmucuotA2dXLF98jGlQ1JShvFVOvUyxs0QKejf323B/mYdoUzvKurP1M +# k+FUjq/w3mgN9oj5oHoCIkdg1gDWNh80zEa0/YxEE7YYzg8bPLsGpK+f7B75Q51Y +# Sz7Gp/LGpQiG/LjytNQmsHwy/bl3FCr5/2WxBkAs8BneisPIfNLW0gfEo5Azkjo9 +# KEm5l8ILkJ3/4Qx9HiGjqwrdto8kGWAlGoIELtsO0BGT4onF4ynlKQgw82JK+4RD +# tWXCnPqjojkl+/4tfbeEdUoPvNgYpvS6ZRRYJIWg5s7XViroohZCCSkqt8aMjTZF +# HJBsKzmdHvVvAGELQ7TKaN3mOMUXb/o4vIK0TYrYN6FUn5iVnA7X2LIbJj0j3Mef +# BwEeOFhSjxz2Ob1oihNBoR1v5y+XfkbT7igIVQqwM27ujcOooOsDkpgizs0FajJV +# jeRsqEsXgfpaKCAq5czpOTutrvvwEn/cINrR3JW1TRSGt3VUvSWkmBs1T+7Oj6H6 +# ewWQaQIDYdEiDUL8OJhl+GzebujxPo//NXTY0MZCxK3DXhXi5okwsImzh5010w== +# SIG # End signature block diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll new file mode 100644 index 000000000000..67edb79248ca Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Core.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll new file mode 100644 index 000000000000..0d214db71cad Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Azure.Identity.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll new file mode 100644 index 000000000000..2b2e59f4a657 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Azure.PowerShell.Authenticators.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll new file mode 100644 index 000000000000..869ac1b86c57 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Bcl.AsyncInterfaces.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll new file mode 100644 index 000000000000..d22ddefa2339 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.Extensions.Msal.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll new file mode 100644 index 000000000000..7f392562319f Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Microsoft.Identity.Client.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll new file mode 100644 index 000000000000..6344999edbb3 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.12.0.3.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll new file mode 100644 index 000000000000..9b0ae142146e Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/Newtonsoft.Json.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll new file mode 100644 index 000000000000..c517a3b62cc7 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Buffers.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll new file mode 100644 index 000000000000..a2b54fb042de Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Diagnostics.DiagnosticSource.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll new file mode 100644 index 000000000000..5aa381018c00 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.Data.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll new file mode 100644 index 000000000000..bdfc501e9647 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Memory.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll new file mode 100644 index 000000000000..8bd471e74c6e Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Net.Http.WinHttpHandler.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll new file mode 100644 index 000000000000..08659724d4f8 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Numerics.Vectors.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll new file mode 100644 index 000000000000..3f9f84edf0ed Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Private.ServiceModel.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll new file mode 100644 index 000000000000..64a57cbbecce Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Reflection.DispatchProxy.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll new file mode 100644 index 000000000000..0c27a0e21c7e Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Runtime.CompilerServices.Unsafe.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll new file mode 100644 index 000000000000..e8074324cd13 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.AccessControl.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll new file mode 100644 index 000000000000..4f4c30e080bd Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Cryptography.Cng.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll new file mode 100644 index 000000000000..d1af38f0f8b7 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Permissions.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll new file mode 100644 index 000000000000..afd187c14918 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Security.Principal.Windows.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll new file mode 100644 index 000000000000..c1aa0a64f8f9 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.ServiceModel.Primitives.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll new file mode 100644 index 000000000000..6d2b207854ac Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Encodings.Web.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll new file mode 100644 index 000000000000..a3a85c2b7255 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Text.Json.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll new file mode 100644 index 000000000000..dfab23478ab4 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Threading.Tasks.Extensions.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll new file mode 100644 index 000000000000..022e63a21a86 Binary files /dev/null and b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/PreloadAssemblies/System.Xml.ReaderWriter.dll differ diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 new file mode 100644 index 000000000000..f234bd2dd7e5 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/StartupScripts/AzError.ps1 @@ -0,0 +1,278 @@ +function Write-InstallationCheckToFile +{ + Param($installationchecks) + if (Get-Module AzureRM.Profile -ListAvailable -ErrorAction Ignore) + { + Write-Warning ("Both Az and AzureRM modules were detected on this machine. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide") + } + + $installationchecks.Add("AzSideBySideCheck","true") + try + { + if (Test-Path $pathToInstallationChecks -ErrorAction Ignore) + { + Remove-Item -Path $pathToInstallationChecks -ErrorAction Stop + } + + $pathToInstallDir = Split-Path -Path $pathToInstallationChecks -Parent -ErrorAction Stop + if (Test-Path $pathToInstallDir -ErrorAction Ignore) + { + New-Item -Path $pathToInstallationChecks -ErrorAction Stop -ItemType File -Value ($installationchecks | ConvertTo-Json -ErrorAction Stop) + } + } + catch + { + Write-Verbose "Installation checks failed to write to file." + } +} + +if (!($env:SkipAzInstallationChecks -eq "true")) +{ + $pathToInstallationChecks = Join-Path (Join-Path $HOME ".Azure") "AzInstallationChecks.json" + $installationchecks = @{} + if (!(Test-Path $pathToInstallationChecks -ErrorAction Ignore)) + { + Write-InstallationCheckToFile $installationchecks + } + else + { + try + { + ((Get-Content $pathToInstallationChecks -ErrorAction Stop) | ConvertFrom-Json -ErrorAction Stop).PSObject.Properties | Foreach { $installationchecks[$_.Name] = $_.Value } + } + catch + { + Write-InstallationCheckToFile $installationchecks + } + + if (!$installationchecks.ContainsKey("AzSideBySideCheck")) + { + Write-InstallationCheckToFile $installationchecks + } + } +} + +if (Get-Module AzureRM.profile -ErrorAction Ignore) +{ + Write-Warning ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") + throw ("AzureRM.Profile already loaded. Az and AzureRM modules cannot be imported in the same session or used in the same script or runbook. If you are running PowerShell in an environment you control you can use the 'Uninstall-AzureRm' cmdlet to remove all AzureRm modules from your machine. " + + "If you are running in Azure Automation, take care that none of your runbooks import both Az and AzureRM modules. More information can be found here: https://aka.ms/azps-migration-guide.") +} + +Update-TypeData -AppendPath (Join-Path (Get-Item $PSScriptRoot).Parent.FullName Accounts.types.ps1xml) -ErrorAction Ignore +# SIG # Begin signature block +# MIInuQYJKoZIhvcNAQcCoIInqjCCJ6YCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCDT3s8rOGw0kP8l +# AbYXJ7G9hr2fOKBRtW5xO6fWVEOZvqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZjjCCGYoCAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgpH7D8Not +# WnytrY9dBBVdkjoPJbp/Jb5/OaJtNH+9PHMwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQBeESsu04jkAEIOu00+XAL5Cw3b4lPK1+Y/A63nt7uC +# g0IvVE66lSl52+b6CVBX/G72fi7HlOIYoCyVKEIasUVN+dqAtdM2ib0RLRPrWxH9 +# 2axBlgxQg9nBAZkklffNIZjmkC+gZN37i3g0DHSwmb1ej9OwHDD0MYQpF8oIa81e +# oj07j6dAzRwVM0TaHEJj9kPXA81HN6CAYBJ/V3p0wYRbp3c2L9j2R9MtVVvnx/7z +# sbKvHJV+l3b/xCT5T0/J5l5QoLzzNyfWB7Zvaz0DbKX1bln/rcb8uPYKVEz4wsKW +# 5zAm12WLQ87vxiIGLA6tv4lXxggEAUm68Nwjfw6vqkHRoYIXGDCCFxQGCisGAQQB +# gjcDAwExghcEMIIXAAYJKoZIhvcNAQcCoIIW8TCCFu0CAQMxDzANBglghkgBZQME +# AgEFADCCAVgGCyqGSIb3DQEJEAEEoIIBRwSCAUMwggE/AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIEbwTnYvqLH2wAcLSr8ZwikKunQnLTH8PEiqd0Vr +# sTtWAgZiMTFcHxoYEjIwMjIwMzMxMTAwMDA4Ljg4WjAEgAIB9KCB2KSB1TCB0jEL +# MAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1v +# bmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWlj +# cm9zb2Z0IElyZWxhbmQgT3BlcmF0aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFs +# ZXMgVFNTIEVTTjpBMjQwLTRCODItMTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRp +# bWUtU3RhbXAgU2VydmljZaCCEWgwggcUMIIE/KADAgECAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpX +# YXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQg +# Q29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAy +# MDEwMB4XDTIxMTAyODE5Mjc0NVoXDTIzMDEyNjE5Mjc0NVowgdIxCzAJBgNVBAYT +# AlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYD +# VQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xLTArBgNVBAsTJE1pY3Jvc29mdCBJ +# cmVsYW5kIE9wZXJhdGlvbnMgTGltaXRlZDEmMCQGA1UECxMdVGhhbGVzIFRTUyBF +# U046QTI0MC00QjgyLTEzMEUxJTAjBgNVBAMTHE1pY3Jvc29mdCBUaW1lLVN0YW1w +# IFNlcnZpY2UwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDaNEgtmD47 +# pTt0ty7AE8wH7S0lTPTAcuonl/soldCxPNZOgANQxhXjFVmen2Y9NaiNQn+Xc7he +# p6AsM124UA5tyK2svJjkcOzEB9QbX/ZiKVxKRI/oJwypZ+xLBQsZfnOWxUocnu2/ +# CDbrLp4uSVR0UymKrb3hPi4lB1d3k7uYXLS9WRoY8bE1YttnEo3Ooq0WdZDuMy1n +# Tle9p+QhZms1MW/wYakCUe1GxnUDwoOjogNIZU1lldtCz587Aw4an8HOh3x/Vgjw +# Zvag3+bHZxy90av2VrnlBl5Wwzst9NoQ9DFuABwuBYOUg9yZPNwGSwTMs5CxKkHO +# yo9pYj3KRXDmh+auQUoxulBPkQySLay4mhUznEaB1lae3+3PTTG5s9IoWLgHggwV +# QH2ZwA1Sr1wdouwdsMn4BSxU7SqdWPDNc9gl5HsL8HxfRSXpSQh2mVmadxBlIErf +# JlDL6gay4kpcUCrcGXFPqQO6Fhi87uK0us95jSSe63WsqTGib66Lq8J22EJ+cCLK +# SfJELaWSerPPzHWYORDlDo7H2nr+V24W6lIky2CwI8318i+t+mkwMUi9GhQuwc50 +# smOtGWLxyjkz69mZ/bShPFi5fMzS1tG6sQnJwHlkxvDOewUfKY6SDLHw54WddXdx +# qvjm56MjUHWKpQNt5I3Ge9zO46FynPBpyQIDAQABo4IBNjCCATIwHQYDVR0OBBYE +# FHjMkW6Hn0bClO5KO7hJNx+WKGaTMB8GA1UdIwQYMBaAFJ+nFV0AXmJdg/Tl0mWn +# G1M1GelyMF8GA1UdHwRYMFYwVKBSoFCGTmh0dHA6Ly93d3cubWljcm9zb2Z0LmNv +# bS9wa2lvcHMvY3JsL01pY3Jvc29mdCUyMFRpbWUtU3RhbXAlMjBQQ0ElMjAyMDEw +# KDEpLmNybDBsBggrBgEFBQcBAQRgMF4wXAYIKwYBBQUHMAKGUGh0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY2VydHMvTWljcm9zb2Z0JTIwVGltZS1TdGFt +# cCUyMFBDQSUyMDIwMTAoMSkuY3J0MAwGA1UdEwEB/wQCMAAwEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwDQYJKoZIhvcNAQELBQADggIBADWvc7PSUSrdW+l0WWHdgHFziGdi +# QAvJg8Nr0U7heCrCQGbwuxv6Ure1sYaCmLpAlsreIzcErQ5sFzBFolULEYsa2von +# P2FG6ZHIXyjifbLdiIq/iiUHE2MVKFIZz0Tb0mZWMGYuCZ+NGo9z/asPbmrijDi4 +# Detz16SJq5+AaFxIB16T+X6QBJvOiE63/nPb4iWBPh7dq5JTO3YYAp8pkHTZkMZY +# op4JjekQuPW26HrJ+s4k88ic7hlktbe+Apq+0vx7oUlnImgMUx7Ann2gQv4Ard7Y +# zYjggUT2fotVLxtL1RsxQy+sCVc3lkzYjwZ0cH1Nt8jXtab/1R/iq7nzw8k3u8Im +# P2z4rFmpdzmwZJwuCqI+ohts1MT78ARn95OLFz1guBPIypqRkjn3AaqOs41BJju7 +# RUQOQQTqKTP4VIVEorOnJJvRZOAy9bGwu9uc3wAKYhI+cEdhmgayw8Avt+gYYoUt +# 0AFNALY9fX1aOt/KuyEd2KpKUKymogYFPFFoe3I8yujcH/bqA98KXcwLesLc0arj +# EacgcNkZKLNSYaDxORACWhV1Tl0nW/3XSCPFrFpStoaE/wi20TRFadTldGn+wZo2 +# YNwzBvIe5KloWyfdDbU7OK0/gGc3m2msdqeAALuOh7jOYueZGcCJRz2xGpDZuaww +# C9Smw7yeU4WaIzUvMIIHcTCCBVmgAwIBAgITMwAAABXF52ueAptJmQAAAAAAFTAN +# BgkqhkiG9w0BAQsFADCBiDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEyMDAGA1UEAxMpTWljcm9zb2Z0IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9y +# aXR5IDIwMTAwHhcNMjEwOTMwMTgyMjI1WhcNMzAwOTMwMTgzMjI1WjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCC +# AgoCggIBAOThpkzntHIhC3miy9ckeb0O1YLT/e6cBwfSqWxOdcjKNVf2AX9sSuDi +# vbk+F2Az/1xPx2b3lVNxWuJ+Slr+uDZnhUYjDLWNE893MsAQGOhgfWpSg0S3po5G +# awcU88V29YZQ3MFEyHFcUTE3oAo4bo3t1w/YJlN8OWECesSq/XJprx2rrPY2vjUm +# ZNqYO7oaezOtgFt+jBAcnVL+tuhiJdxqD89d9P6OU8/W7IVWTe/dvI2k45GPsjks +# UZzpcGkNyjYtcI4xyDUoveO0hyTD4MmPfrVUj9z6BVWYbWg7mka97aSueik3rMvr +# g0XnRm7KMtXAhjBcTyziYrLNueKNiOSWrAFKu75xqRdbZ2De+JKRHh09/SDPc31B +# mkZ1zcRfNN0Sidb9pSB9fvzZnkXftnIv231fgLrbqn427DZM9ituqBJR6L8FA6PR +# c6ZNN3SUHDSCD/AQ8rdHGO2n6Jl8P0zbr17C89XYcz1DTsEzOUyOArxCaC4Q6oRR +# RuLRvWoYWmEBc8pnol7XKHYC4jMYctenIPDC+hIK12NvDMk2ZItboKaDIV1fMHSR +# lJTYuVD5C4lh8zYGNRiER9vcG9H9stQcxWv2XFJRXRLbJbqvUAV6bMURHXLvjflS +# xIUXk8A8FdsaN8cIFRg/eKtFtvUeh17aj54WcmnGrnu3tz5q4i6tAgMBAAGjggHd +# MIIB2TASBgkrBgEEAYI3FQEEBQIDAQABMCMGCSsGAQQBgjcVAgQWBBQqp1L+ZMSa +# voKRPEY1Kc8Q/y8E7jAdBgNVHQ4EFgQUn6cVXQBeYl2D9OXSZacbUzUZ6XIwXAYD +# VR0gBFUwUzBRBgwrBgEEAYI3TIN9AQEwQTA/BggrBgEFBQcCARYzaHR0cDovL3d3 +# dy5taWNyb3NvZnQuY29tL3BraW9wcy9Eb2NzL1JlcG9zaXRvcnkuaHRtMBMGA1Ud +# JQQMMAoGCCsGAQUFBwMIMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNX2VsuP6KJcYmjR +# PZSQW9fOmhjEMFYGA1UdHwRPME0wS6BJoEeGRWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dF8yMDEwLTA2LTIzLmNy +# bDBaBggrBgEFBQcBAQROMEwwSgYIKwYBBQUHMAKGPmh0dHA6Ly93d3cubWljcm9z +# b2Z0LmNvbS9wa2kvY2VydHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3J0MA0G +# CSqGSIb3DQEBCwUAA4ICAQCdVX38Kq3hLB9nATEkW+Geckv8qW/qXBS2Pk5HZHix +# BpOXPTEztTnXwnE2P9pkbHzQdTltuw8x5MKP+2zRoZQYIu7pZmc6U03dmLq2HnjY +# Ni6cqYJWAAOwBb6J6Gngugnue99qb74py27YP0h1AdkY3m2CDPVtI1TkeFN1JFe5 +# 3Z/zjj3G82jfZfakVqr3lbYoVSfQJL1AoL8ZthISEV09J+BAljis9/kpicO8F7BU +# hUKz/AyeixmJ5/ALaoHCgRlCGVJ1ijbCHcNhcy4sa3tuPywJeBTpkbKpW99Jo3QM +# vOyRgNI95ko+ZjtPu4b6MhrZlvSP9pEB9s7GdP32THJvEKt1MMU0sHrYUP4KWN1A +# PMdUbZ1jdEgssU5HLcEUBHG/ZPkkvnNtyo4JvbMBV0lUZNlz138eW0QBjloZkWsN +# n6Qo3GcZKCS6OEuabvshVGtqRRFHqfG3rsjoiV5PndLQTHa1V1QJsWkBRH58oWFs +# c/4Ku+xBZj1p/cvBQUl+fpO+y/g75LcVv7TOPqUxUYS8vwLBgqJ7Fx0ViY1w/ue1 +# 0CgaiQuPNtq6TPmb/wrpNPgkNWcr4A245oyZ1uEi6vAnQj0llOZ0dFtq0Z4+7X6g +# MTN9vMvpe784cETRkPHIqzqKOghif9lwY1NNje6CbaUFEMFxBmoQtB1VM1izoXBm +# 8qGCAtcwggJAAgEBMIIBAKGB2KSB1TCB0jELMAkGA1UEBhMCVVMxEzARBgNVBAgT +# Cldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29m +# dCBDb3Jwb3JhdGlvbjEtMCsGA1UECxMkTWljcm9zb2Z0IElyZWxhbmQgT3BlcmF0 +# aW9ucyBMaW1pdGVkMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjpBMjQwLTRCODIt +# MTMwRTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEB +# MAcGBSsOAwIaAxUAgHOVkz1NE0Pg+C2ktZBmRI9hVwmggYMwgYCkfjB8MQswCQYD +# VQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEe +# MBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3Nv +# ZnQgVGltZS1TdGFtcCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXvddYwIhgP +# MjAyMjAzMzEwODM1MzRaGA8yMDIyMDQwMTA4MzUzNFowdzA9BgorBgEEAYRZCgQB +# MS8wLTAKAgUA5e911gIBADAKAgEAAgIXqQIB/zAHAgEAAgIRHzAKAgUA5fDHVgIB +# ADA2BgorBgEEAYRZCgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQow +# CAIBAAIDAYagMA0GCSqGSIb3DQEBBQUAA4GBABjrSR17sdYAEtszvl2BWos/C7ZR +# fepANqhK1OqRLv3nelgcpzoYSpF3+csIJ5gGoL5clExMw1t3hkOSQLOzGWvkcWIY +# Tp5Pv4q/CpB/52Mrn1kC2zSej1E9lx0InBB++pTdEr3WCn9KDZsIy8B9M3gtEamp +# Di1hg/Yaskk2pVuQMYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNV +# BAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jv +# c29mdCBDb3Jwb3JhdGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAg +# UENBIDIwMTACEzMAAAGNelUueHSZKrcAAQAAAY0wDQYJYIZIAWUDBAIBBQCgggFK +# MBoGCSqGSIb3DQEJAzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgv72G +# 0X2zWUJuJvjSqtgMZ02BVYmEgLTkIUsRp8UHvXIwgfoGCyqGSIb3DQEJEAIvMYHq +# MIHnMIHkMIG9BCCelhEz+h1eQMCfN/a50vnr1bxx8ZODBW56dDy20hjNfzCBmDCB +# gKR+MHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQH +# EwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNV +# BAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABjXpVLnh0mSq3 +# AAEAAAGNMCIEIKC8K55Td1F8Kw4pKkbmiSw7Hb/xIcUSNIsHKB52X2hTMA0GCSqG +# SIb3DQEBCwUABIICAMsOXK3vJQX7Jt2lDwVppNTdiboPDVwXRfezsK8NLGK7wZhp +# e/fEsGp3kFdqmeiDT/QGZV+ixnGjOTyJSaq6+wtvZyqKLUoEkhD9g+hFk23Hn3ui +# RiAp6LSf263zzgNQ9SbNssjiOChkILaTpt+GeV+lHAH6N412gYM7pbVyw9v7jvx+ +# Mp+iFKUVQAqZZDGm55MyTqfVdPeb8YpN9pqPSYG4ruCTwZBYGI+p7LFuKgQqF+FB +# 2KTqsTuxoHI6HAV3OibJcIFKQLFxaHjD0/YjYeZSoMUMD/ojZpdEoFrLtTXmIZ2e +# yOFKcX1LMzwwHhEpOpc9m9g4/B2kYTHUl1hFupXEu9PZnNa0IweqtM/GdX/Ji/// +# JRcDe8vtLNQz7z8ZQF28k1ufRDGfm5YIQDHu9Zx33gbpsWIyGZMmlbU4UMJDvAbM +# +sCYtGGLcMEObyiurnDOF4dix7QAdLWqGG2YiyZ9u0T/hRLi3THXhLGK5Xt4dgBk +# aeyJv7T3ZPfsbu8a10lgFkyVbmJt6up2OZbaqW1PjmvgtcsNmRyhD9oSZzOXdTiW +# iIGeLtHEkiSvZnWbaDqpx7ahcaHsmS5QvwWkYGGx1uHMOwJHuFq7jKPo3SYMxAwq +# GQW+QTZroDYL+UTfaUobfPyrS3bDw3L7xVqOOBwGidlOwx3ZYU4mNlSbfCN3 +# SIG # End signature block diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 new file mode 100644 index 000000000000..4e557723dc33 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/StartupScripts/InitializeAssemblyResolver.ps1 @@ -0,0 +1,234 @@ +if ($PSEdition -eq 'Desktop') { + try { + [Microsoft.Azure.Commands.Profile.Utilities.CustomAssemblyResolver]::Initialize() + } + catch { + Write-Warning $_ + } +} +else { + try { + Add-Type -Path ([System.IO.Path]::Combine($PSScriptRoot, "..", "Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.dll")) | Out-Null + $assemblyLoadContextFolder = [System.IO.Path]::Combine($PSScriptRoot, "..", "AzSharedAlcAssemblies") + Write-Debug "Registering Az shared AssemblyLoadContext for path: '$assemblyLoadContextFolder'." + [Microsoft.Azure.PowerShell.AuthenticationAssemblyLoadContext.AzAssemblyLoadContextInitializer]::RegisterAzSharedAssemblyLoadContext($assemblyLoadContextFolder) + Write-Debug "AssemblyLoadContext registered." + } + catch { + Write-Warning $_ + } +} +# SIG # Begin signature block +# MIInrQYJKoZIhvcNAQcCoIInnjCCJ5oCAQExDzANBglghkgBZQMEAgEFADB5Bgor +# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG +# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCCfno9x0LEd5gPe +# 4cvAg6ULJtMLR6g+Xis+I4rbSZlHZqCCDYEwggX/MIID56ADAgECAhMzAAACUosz +# qviV8znbAAAAAAJSMA0GCSqGSIb3DQEBCwUAMH4xCzAJBgNVBAYTAlVTMRMwEQYD +# VQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMTH01pY3Jvc29mdCBDb2RlIFNpZ25p +# bmcgUENBIDIwMTEwHhcNMjEwOTAyMTgzMjU5WhcNMjIwOTAxMTgzMjU5WjB0MQsw +# CQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9u +# ZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMR4wHAYDVQQDExVNaWNy +# b3NvZnQgQ29ycG9yYXRpb24wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +# AQDQ5M+Ps/X7BNuv5B/0I6uoDwj0NJOo1KrVQqO7ggRXccklyTrWL4xMShjIou2I +# sbYnF67wXzVAq5Om4oe+LfzSDOzjcb6ms00gBo0OQaqwQ1BijyJ7NvDf80I1fW9O +# L76Kt0Wpc2zrGhzcHdb7upPrvxvSNNUvxK3sgw7YTt31410vpEp8yfBEl/hd8ZzA +# v47DCgJ5j1zm295s1RVZHNp6MoiQFVOECm4AwK2l28i+YER1JO4IplTH44uvzX9o +# RnJHaMvWzZEpozPy4jNO2DDqbcNs4zh7AWMhE1PWFVA+CHI/En5nASvCvLmuR/t8 +# q4bc8XR8QIZJQSp+2U6m2ldNAgMBAAGjggF+MIIBejAfBgNVHSUEGDAWBgorBgEE +# AYI3TAgBBggrBgEFBQcDAzAdBgNVHQ4EFgQUNZJaEUGL2Guwt7ZOAu4efEYXedEw +# UAYDVR0RBEkwR6RFMEMxKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1 +# ZXJ0byBSaWNvMRYwFAYDVQQFEw0yMzAwMTIrNDY3NTk3MB8GA1UdIwQYMBaAFEhu +# ZOVQBdOCqhc3NyK1bajKdQKVMFQGA1UdHwRNMEswSaBHoEWGQ2h0dHA6Ly93d3cu +# bWljcm9zb2Z0LmNvbS9wa2lvcHMvY3JsL01pY0NvZFNpZ1BDQTIwMTFfMjAxMS0w +# Ny0wOC5jcmwwYQYIKwYBBQUHAQEEVTBTMFEGCCsGAQUFBzAChkVodHRwOi8vd3d3 +# Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2NlcnRzL01pY0NvZFNpZ1BDQTIwMTFfMjAx +# MS0wNy0wOC5jcnQwDAYDVR0TAQH/BAIwADANBgkqhkiG9w0BAQsFAAOCAgEAFkk3 +# uSxkTEBh1NtAl7BivIEsAWdgX1qZ+EdZMYbQKasY6IhSLXRMxF1B3OKdR9K/kccp +# kvNcGl8D7YyYS4mhCUMBR+VLrg3f8PUj38A9V5aiY2/Jok7WZFOAmjPRNNGnyeg7 +# l0lTiThFqE+2aOs6+heegqAdelGgNJKRHLWRuhGKuLIw5lkgx9Ky+QvZrn/Ddi8u +# TIgWKp+MGG8xY6PBvvjgt9jQShlnPrZ3UY8Bvwy6rynhXBaV0V0TTL0gEx7eh/K1 +# o8Miaru6s/7FyqOLeUS4vTHh9TgBL5DtxCYurXbSBVtL1Fj44+Od/6cmC9mmvrti +# yG709Y3Rd3YdJj2f3GJq7Y7KdWq0QYhatKhBeg4fxjhg0yut2g6aM1mxjNPrE48z +# 6HWCNGu9gMK5ZudldRw4a45Z06Aoktof0CqOyTErvq0YjoE4Xpa0+87T/PVUXNqf +# 7Y+qSU7+9LtLQuMYR4w3cSPjuNusvLf9gBnch5RqM7kaDtYWDgLyB42EfsxeMqwK +# WwA+TVi0HrWRqfSx2olbE56hJcEkMjOSKz3sRuupFCX3UroyYf52L+2iVTrda8XW +# esPG62Mnn3T8AuLfzeJFuAbfOSERx7IFZO92UPoXE1uEjL5skl1yTZB3MubgOA4F +# 8KoRNhviFAEST+nG8c8uIsbZeb08SeYQMqjVEmkwggd6MIIFYqADAgECAgphDpDS +# AAAAAAADMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMK +# V2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0 +# IENvcnBvcmF0aW9uMTIwMAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0 +# ZSBBdXRob3JpdHkgMjAxMTAeFw0xMTA3MDgyMDU5MDlaFw0yNjA3MDgyMTA5MDla +# MH4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdS +# ZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKDAmBgNVBAMT +# H01pY3Jvc29mdCBDb2RlIFNpZ25pbmcgUENBIDIwMTEwggIiMA0GCSqGSIb3DQEB +# AQUAA4ICDwAwggIKAoICAQCr8PpyEBwurdhuqoIQTTS68rZYIZ9CGypr6VpQqrgG +# OBoESbp/wwwe3TdrxhLYC/A4wpkGsMg51QEUMULTiQ15ZId+lGAkbK+eSZzpaF7S +# 35tTsgosw6/ZqSuuegmv15ZZymAaBelmdugyUiYSL+erCFDPs0S3XdjELgN1q2jz +# y23zOlyhFvRGuuA4ZKxuZDV4pqBjDy3TQJP4494HDdVceaVJKecNvqATd76UPe/7 +# 4ytaEB9NViiienLgEjq3SV7Y7e1DkYPZe7J7hhvZPrGMXeiJT4Qa8qEvWeSQOy2u +# M1jFtz7+MtOzAz2xsq+SOH7SnYAs9U5WkSE1JcM5bmR/U7qcD60ZI4TL9LoDho33 +# X/DQUr+MlIe8wCF0JV8YKLbMJyg4JZg5SjbPfLGSrhwjp6lm7GEfauEoSZ1fiOIl +# XdMhSz5SxLVXPyQD8NF6Wy/VI+NwXQ9RRnez+ADhvKwCgl/bwBWzvRvUVUvnOaEP +# 6SNJvBi4RHxF5MHDcnrgcuck379GmcXvwhxX24ON7E1JMKerjt/sW5+v/N2wZuLB +# l4F77dbtS+dJKacTKKanfWeA5opieF+yL4TXV5xcv3coKPHtbcMojyyPQDdPweGF +# RInECUzF1KVDL3SV9274eCBYLBNdYJWaPk8zhNqwiBfenk70lrC8RqBsmNLg1oiM +# CwIDAQABo4IB7TCCAekwEAYJKwYBBAGCNxUBBAMCAQAwHQYDVR0OBBYEFEhuZOVQ +# BdOCqhc3NyK1bajKdQKVMBkGCSsGAQQBgjcUAgQMHgoAUwB1AGIAQwBBMAsGA1Ud +# DwQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFHItOgIxkEO5FAVO +# 4eqnxzHRI4k0MFoGA1UdHwRTMFEwT6BNoEuGSWh0dHA6Ly9jcmwubWljcm9zb2Z0 +# LmNvbS9wa2kvY3JsL3Byb2R1Y3RzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcmwwXgYIKwYBBQUHAQEEUjBQME4GCCsGAQUFBzAChkJodHRwOi8vd3d3Lm1p +# Y3Jvc29mdC5jb20vcGtpL2NlcnRzL01pY1Jvb0NlckF1dDIwMTFfMjAxMV8wM18y +# Mi5jcnQwgZ8GA1UdIASBlzCBlDCBkQYJKwYBBAGCNy4DMIGDMD8GCCsGAQUFBwIB +# FjNodHRwOi8vd3d3Lm1pY3Jvc29mdC5jb20vcGtpb3BzL2RvY3MvcHJpbWFyeWNw +# cy5odG0wQAYIKwYBBQUHAgIwNB4yIB0ATABlAGcAYQBsAF8AcABvAGwAaQBjAHkA +# XwBzAHQAYQB0AGUAbQBlAG4AdAAuIB0wDQYJKoZIhvcNAQELBQADggIBAGfyhqWY +# 4FR5Gi7T2HRnIpsLlhHhY5KZQpZ90nkMkMFlXy4sPvjDctFtg/6+P+gKyju/R6mj +# 82nbY78iNaWXXWWEkH2LRlBV2AySfNIaSxzzPEKLUtCw/WvjPgcuKZvmPRul1LUd +# d5Q54ulkyUQ9eHoj8xN9ppB0g430yyYCRirCihC7pKkFDJvtaPpoLpWgKj8qa1hJ +# Yx8JaW5amJbkg/TAj/NGK978O9C9Ne9uJa7lryft0N3zDq+ZKJeYTQ49C/IIidYf +# wzIY4vDFLc5bnrRJOQrGCsLGra7lstnbFYhRRVg4MnEnGn+x9Cf43iw6IGmYslmJ +# aG5vp7d0w0AFBqYBKig+gj8TTWYLwLNN9eGPfxxvFX1Fp3blQCplo8NdUmKGwx1j +# NpeG39rz+PIWoZon4c2ll9DuXWNB41sHnIc+BncG0QaxdR8UvmFhtfDcxhsEvt9B +# xw4o7t5lL+yX9qFcltgA1qFGvVnzl6UJS0gQmYAf0AApxbGbpT9Fdx41xtKiop96 +# eiL6SJUfq/tHI4D1nvi/a7dLl+LrdXga7Oo3mXkYS//WsyNodeav+vyL6wuA6mk7 +# r/ww7QRMjt/fdW1jkT3RnVZOT7+AVyKheBEyIXrvQQqxP/uozKRdwaGIm1dxVk5I +# RcBCyZt2WwqASGv9eZ/BvW1taslScxMNelDNMYIZgjCCGX4CAQEwgZUwfjELMAkG +# A1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0b24xEDAOBgNVBAcTB1JlZG1vbmQx +# HjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3JhdGlvbjEoMCYGA1UEAxMfTWljcm9z +# b2Z0IENvZGUgU2lnbmluZyBQQ0EgMjAxMQITMwAAAlKLM6r4lfM52wAAAAACUjAN +# BglghkgBZQMEAgEFAKCBrjAZBgkqhkiG9w0BCQMxDAYKKwYBBAGCNwIBBDAcBgor +# BgEEAYI3AgELMQ4wDAYKKwYBBAGCNwIBFTAvBgkqhkiG9w0BCQQxIgQgyFkgUqEG +# ohT1KbDw544Hgmj3zWoOXkAlMHIwAyFcowAwQgYKKwYBBAGCNwIBDDE0MDKgFIAS +# AE0AaQBjAHIAbwBzAG8AZgB0oRqAGGh0dHA6Ly93d3cubWljcm9zb2Z0LmNvbTAN +# BgkqhkiG9w0BAQEFAASCAQCa0t0uHrS1Z8rXJEETxc2oe78Dv4Qo198ub5+3zLvP +# Uwb+RkVmouToXjo3dapicrrP8ELcphopBonxGcVJFdu9HT8uuwL9KEp0yDpjUxKA +# 0yPVc1pc+f5vmlLY1kyUHMb9Deahzp5oJnL6NLyupJ8w6DLb21SCiIWl71l5vf2B +# i8Nx+jIjxGEC5Emqk6GLFAjR4TR6KO1j6gkHutOu3k0Q/+CgvgEwPbwtBXjcE9jV +# u7AZ6Iu5mE8q7NQ01GwWUMs13xpWLxE8HgvWtu3ozXjFeFaG3u9NEyx/zlkEB1cS +# Ntqh/F34ovkTvJxnIBPSRZfGubCV0fp9Qm0gXxrz3y/roYIXDDCCFwgGCisGAQQB +# gjcDAwExghb4MIIW9AYJKoZIhvcNAQcCoIIW5TCCFuECAQMxDzANBglghkgBZQME +# AgEFADCCAVUGCyqGSIb3DQEJEAEEoIIBRASCAUAwggE8AgEBBgorBgEEAYRZCgMB +# MDEwDQYJYIZIAWUDBAIBBQAEIBvIyrpwHucEdb9YUkDCNmUPQk1ErTyZteMy3AB+ +# P++VAgZiL7Y+PNcYEzIwMjIwMzMxMTAwMDA5LjE3NlowBIACAfSggdSkgdEwgc4x +# CzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRt +# b25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1p +# Y3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMg +# VFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUt +# U3RhbXAgU2VydmljZaCCEV8wggcQMIIE+KADAgECAhMzAAABpllFgzlNnutLAAEA +# AAGmMA0GCSqGSIb3DQEBCwUAMHwxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNo +# aW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29y +# cG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1lLVN0YW1wIFBDQSAyMDEw +# MB4XDTIyMDMwMjE4NTEyMVoXDTIzMDUxMTE4NTEyMVowgc4xCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVy +# YXRpb25zIFB1ZXJ0byBSaWNvMSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJD +# LUUzODMtMjYzNTElMCMGA1UEAxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2Vydmlj +# ZTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANmYv3tSI+fJ/NQJnjz7 +# JvCnc+Xm0rKoe9YKD4MvMYCul7egdrT/zv5vFbQgjNQ74672fNweaztkR65V8y29 +# u5PL2sf01p+uche0Zu4tSig+GsQ6ZQl9tjPRAY/3ITBHDeIYyvq8Wne9+7NoPLhx +# DSO6dtX7YCuQ4zcTP3SE6MvB4b5NighdtvoZVaYk1lXpjUTfdmKoX1ABq1sJbULS +# nSi0Qd4vvl3mZ9jxwv9dR/nlZP62lrZYZq7LPtHD6BlmclB5PT89DnSm1sjaZnFH +# rKzOsmq5GlmL5SFugCCZOoKz133FJeQaFMcXBZSCQjNABWBbHIRCE1ysHHG83Ddo +# nRmnC8EOlYeRwTWz/QCz6q0riOIbYyC/A2BgUEpu9/9EymrTsyMr2/zS8GdEybQ5 +# W7f0WrcrmKB/Y62+g6TmfOS8NtU+L1jGoKNG6Q5RlfJwZu8J/Q9dl4OxyHKuy78+ +# wm6HsF7uAizpsWh63UUaoK/OGQiBG3NJ+kef5eWpnva4ZJfhAnqYTAZD1uHgf8Vf +# Qjnl0BB2YXzK9WaTqde8d+8qCxVKr5hJYvbO+X3+2k5PCirUK/SboreX+xUhVaQE +# hVDYqlatyPttI7Z2IrkhMzwFvc+p0QeyMiNmo2cBZejx8icDOcUidwymDUYqGPE7 +# MA8vtKW3feeSSYJsCEkuUO/vAgMBAAGjggE2MIIBMjAdBgNVHQ4EFgQUOlQhO/zG +# lqK99UkNL/Gu/AryN9gwHwYDVR0jBBgwFoAUn6cVXQBeYl2D9OXSZacbUzUZ6XIw +# XwYDVR0fBFgwVjBUoFKgUIZOaHR0cDovL3d3dy5taWNyb3NvZnQuY29tL3BraW9w +# cy9jcmwvTWljcm9zb2Z0JTIwVGltZS1TdGFtcCUyMFBDQSUyMDIwMTAoMSkuY3Js +# MGwGCCsGAQUFBwEBBGAwXjBcBggrBgEFBQcwAoZQaHR0cDovL3d3dy5taWNyb3Nv +# ZnQuY29tL3BraW9wcy9jZXJ0cy9NaWNyb3NvZnQlMjBUaW1lLVN0YW1wJTIwUENB +# JTIwMjAxMCgxKS5jcnQwDAYDVR0TAQH/BAIwADATBgNVHSUEDDAKBggrBgEFBQcD +# CDANBgkqhkiG9w0BAQsFAAOCAgEAgMDxWDTpGqLnFoPhm/iDfwHGF8xr2NbrJl8e +# gEg2ThTJsTf0wBE+ZQsnYfrRmXBbe6sCXLVN70qPuI+OEbN5MOai7Bue1/4j5VTk +# WquH5GZeVat2N+dD7lSUWp0dU8j+uBhBL5GFSmoDVVm+zW2GR2juPI1v254AJTb2 +# l458anlkJjGvmYn2BtRS13h/wDR7hrQaI7BgdyHWAV5+HEj5UhrIrrvtwJiivSaU +# EA3qK6ZK/rZIQv/uORDkONw+2pHHIE1SXm/WIlhrVS2HIogfr3JjqvZion6LJSD7 +# 41j8xVDLiClwAbspHoVFjxtxBcMjqPx6aWCJS8vjSoTnhkV4PO55mqsM7Q8XQRGQ +# hA7w4zNQOJu9kD4xFdYpPUmLN/daIcEElofBjGz+sEd1B4yqqIk3u2G4VygTXFmt +# hL8chSo7r+GIvTqWKhSA/sanS4N3jCgCCe3FTSJsp4g5nwavLvWAtzcOIvSRorGm +# AeN0m2wgzBK95T/qgrGGDXSos1JNDWRVBnP0qsw1Qoq5G0D8hxvQPs3X43KBv1GJ +# l0wo5rcC+9OMWxJlB63gtToQsA1CErYoYLMZtUzJL74jwZk/grpHEQhIhB3sneC8 +# wzGKJuft7YO/HWCpuwdChIjynTnBh+yFGMdg3wRrIbOcw/iKmXZopMTQMOcmIeIw +# JAezA7AwggdxMIIFWaADAgECAhMzAAAAFcXna54Cm0mZAAAAAAAVMA0GCSqGSIb3 +# DQEBCwUAMIGIMQswCQYDVQQGEwJVUzETMBEGA1UECBMKV2FzaGluZ3RvbjEQMA4G +# A1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTIw +# MAYDVQQDEylNaWNyb3NvZnQgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgMjAx +# MDAeFw0yMTA5MzAxODIyMjVaFw0zMDA5MzAxODMyMjVaMHwxCzAJBgNVBAYTAlVT +# MRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQK +# ExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29mdCBUaW1l +# LVN0YW1wIFBDQSAyMDEwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA +# 5OGmTOe0ciELeaLL1yR5vQ7VgtP97pwHB9KpbE51yMo1V/YBf2xK4OK9uT4XYDP/ +# XE/HZveVU3Fa4n5KWv64NmeFRiMMtY0Tz3cywBAY6GB9alKDRLemjkZrBxTzxXb1 +# hlDcwUTIcVxRMTegCjhuje3XD9gmU3w5YQJ6xKr9cmmvHaus9ja+NSZk2pg7uhp7 +# M62AW36MEBydUv626GIl3GoPz130/o5Tz9bshVZN7928jaTjkY+yOSxRnOlwaQ3K +# Ni1wjjHINSi947SHJMPgyY9+tVSP3PoFVZhtaDuaRr3tpK56KTesy+uDRedGbsoy +# 1cCGMFxPLOJiss254o2I5JasAUq7vnGpF1tnYN74kpEeHT39IM9zfUGaRnXNxF80 +# 3RKJ1v2lIH1+/NmeRd+2ci/bfV+AutuqfjbsNkz2K26oElHovwUDo9Fzpk03dJQc +# NIIP8BDyt0cY7afomXw/TNuvXsLz1dhzPUNOwTM5TI4CvEJoLhDqhFFG4tG9ahha +# YQFzymeiXtcodgLiMxhy16cg8ML6EgrXY28MyTZki1ugpoMhXV8wdJGUlNi5UPkL +# iWHzNgY1GIRH29wb0f2y1BzFa/ZcUlFdEtsluq9QBXpsxREdcu+N+VLEhReTwDwV +# 2xo3xwgVGD94q0W29R6HXtqPnhZyacaue7e3PmriLq0CAwEAAaOCAd0wggHZMBIG +# CSsGAQQBgjcVAQQFAgMBAAEwIwYJKwYBBAGCNxUCBBYEFCqnUv5kxJq+gpE8RjUp +# zxD/LwTuMB0GA1UdDgQWBBSfpxVdAF5iXYP05dJlpxtTNRnpcjBcBgNVHSAEVTBT +# MFEGDCsGAQQBgjdMg30BATBBMD8GCCsGAQUFBwIBFjNodHRwOi8vd3d3Lm1pY3Jv +# c29mdC5jb20vcGtpb3BzL0RvY3MvUmVwb3NpdG9yeS5odG0wEwYDVR0lBAwwCgYI +# KwYBBQUHAwgwGQYJKwYBBAGCNxQCBAweCgBTAHUAYgBDAEEwCwYDVR0PBAQDAgGG +# MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAU1fZWy4/oolxiaNE9lJBb186a +# GMQwVgYDVR0fBE8wTTBLoEmgR4ZFaHR0cDovL2NybC5taWNyb3NvZnQuY29tL3Br +# aS9jcmwvcHJvZHVjdHMvTWljUm9vQ2VyQXV0XzIwMTAtMDYtMjMuY3JsMFoGCCsG +# AQUFBwEBBE4wTDBKBggrBgEFBQcwAoY+aHR0cDovL3d3dy5taWNyb3NvZnQuY29t +# L3BraS9jZXJ0cy9NaWNSb29DZXJBdXRfMjAxMC0wNi0yMy5jcnQwDQYJKoZIhvcN +# AQELBQADggIBAJ1VffwqreEsH2cBMSRb4Z5yS/ypb+pcFLY+TkdkeLEGk5c9MTO1 +# OdfCcTY/2mRsfNB1OW27DzHkwo/7bNGhlBgi7ulmZzpTTd2YurYeeNg2LpypglYA +# A7AFvonoaeC6Ce5732pvvinLbtg/SHUB2RjebYIM9W0jVOR4U3UkV7ndn/OOPcbz +# aN9l9qRWqveVtihVJ9AkvUCgvxm2EhIRXT0n4ECWOKz3+SmJw7wXsFSFQrP8DJ6L +# GYnn8AtqgcKBGUIZUnWKNsIdw2FzLixre24/LAl4FOmRsqlb30mjdAy87JGA0j3m +# Sj5mO0+7hvoyGtmW9I/2kQH2zsZ0/fZMcm8Qq3UwxTSwethQ/gpY3UA8x1RtnWN0 +# SCyxTkctwRQEcb9k+SS+c23Kjgm9swFXSVRk2XPXfx5bRAGOWhmRaw2fpCjcZxko +# JLo4S5pu+yFUa2pFEUep8beuyOiJXk+d0tBMdrVXVAmxaQFEfnyhYWxz/gq77EFm +# PWn9y8FBSX5+k77L+DvktxW/tM4+pTFRhLy/AsGConsXHRWJjXD+57XQKBqJC482 +# 2rpM+Zv/Cuk0+CQ1ZyvgDbjmjJnW4SLq8CdCPSWU5nR0W2rRnj7tfqAxM328y+l7 +# vzhwRNGQ8cirOoo6CGJ/2XBjU02N7oJtpQUQwXEGahC0HVUzWLOhcGbyoYIC0jCC +# AjsCAQEwgfyhgdSkgdEwgc4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5n +# dG9uMRAwDgYDVQQHEwdSZWRtb25kMR4wHAYDVQQKExVNaWNyb3NvZnQgQ29ycG9y +# YXRpb24xKTAnBgNVBAsTIE1pY3Jvc29mdCBPcGVyYXRpb25zIFB1ZXJ0byBSaWNv +# MSYwJAYDVQQLEx1UaGFsZXMgVFNTIEVTTjo2MEJDLUUzODMtMjYzNTElMCMGA1UE +# AxMcTWljcm9zb2Z0IFRpbWUtU3RhbXAgU2VydmljZaIjCgEBMAcGBSsOAwIaAxUA +# anQzrZW9TB93Ve7Pa4UPao2ffK2ggYMwgYCkfjB8MQswCQYDVQQGEwJVUzETMBEG +# A1UECBMKV2FzaGluZ3RvbjEQMA4GA1UEBxMHUmVkbW9uZDEeMBwGA1UEChMVTWlj +# cm9zb2Z0IENvcnBvcmF0aW9uMSYwJAYDVQQDEx1NaWNyb3NvZnQgVGltZS1TdGFt +# cCBQQ0EgMjAxMDANBgkqhkiG9w0BAQUFAAIFAOXv9TcwIhgPMjAyMjAzMzExMzM5 +# MDNaGA8yMDIyMDQwMTEzMzkwM1owdzA9BgorBgEEAYRZCgQBMS8wLTAKAgUA5e/1 +# NwIBADAKAgEAAgIlMAIB/zAHAgEAAgIRCDAKAgUA5fFGtwIBADA2BgorBgEEAYRZ +# CgQCMSgwJjAMBgorBgEEAYRZCgMCoAowCAIBAAIDB6EgoQowCAIBAAIDAYagMA0G +# CSqGSIb3DQEBBQUAA4GBALD1RzDUwq+H9m0MSYjCz5wQ1OtK2kysUfWmpMU4m/5I +# had8kbNZdJ3KIrx0YGBUzNZ+Lq0oh2bND8oZcOvd2Hp24j+V7qoE3si8uVWGudxS +# modF1/mMXXk9ekKyQlZEjz3BMuu37KSyigsrBtFsCP8HOYXKBGcDbc6qn5XH4yKD +# MYIEDTCCBAkCAQEwgZMwfDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCldhc2hpbmd0 +# b24xEDAOBgNVBAcTB1JlZG1vbmQxHjAcBgNVBAoTFU1pY3Jvc29mdCBDb3Jwb3Jh +# dGlvbjEmMCQGA1UEAxMdTWljcm9zb2Z0IFRpbWUtU3RhbXAgUENBIDIwMTACEzMA +# AAGmWUWDOU2e60sAAQAAAaYwDQYJYIZIAWUDBAIBBQCgggFKMBoGCSqGSIb3DQEJ +# AzENBgsqhkiG9w0BCRABBDAvBgkqhkiG9w0BCQQxIgQgBSF4kR8GItz8rwRGC1l8 +# k8ybbSy8clYGHzCOxkaX3MUwgfoGCyqGSIb3DQEJEAIvMYHqMIHnMIHkMIG9BCCD +# CxmLwz90fWvhMKbJTAQaKt3DoXeiAhfp8TD9tgSrDTCBmDCBgKR+MHwxCzAJBgNV +# BAYTAlVTMRMwEQYDVQQIEwpXYXNoaW5ndG9uMRAwDgYDVQQHEwdSZWRtb25kMR4w +# HAYDVQQKExVNaWNyb3NvZnQgQ29ycG9yYXRpb24xJjAkBgNVBAMTHU1pY3Jvc29m +# dCBUaW1lLVN0YW1wIFBDQSAyMDEwAhMzAAABpllFgzlNnutLAAEAAAGmMCIEIBah +# XRJ2u8MV3DcxWnj3RsKu1063lhZi+mCg8CTJsOXVMA0GCSqGSIb3DQEBCwUABIIC +# AKwjzxsDe/9a9+S3w9P62SVFf6qdfGVu9TFSVozXaesncRAk2r5PYVIzQBLXEctH +# uMjKgizzU+OOxm1sxXQFxUa56d7W+W0Jg7ULtoKBKPQtEUN5uAo4j2bxZGMLqPMd +# DR5oFeKvtuIUk4DiXx02gUT6GITVUnFkkHt4y9j9PwZb7TNlan8/wTeTHO0kH2QZ +# xSt9oLx0jSb5/nBUCAE7G38h6P29oMvljU4xleVaSon0n73QlTg/hMAedxBVDol7 +# ZFh6Q93jDq/8l4XsA4y1UIObDo/8NxDvISc2tYeybT++wrtwkOLw6jpWXezk4uA3 +# cPi5rfOQhiBPG8dLCT9SWelaQWFq6wDL/wWQWWohrMVGaRoIp+p7TrRTUl3eoGIW +# lvUbTuUotQzzmQY1Zf8S4g430lulVYqdenhq6E3mzdU9VjueouAji4yYyJ8jeZmz +# c2e2W3goWOO5UWBujRETmFekpuj1cPiQ1en4QlRDeDHIgUa8OQcFbhof3cXZ0+CM +# mFYy5NofggR5oWN1IO6TAGc5w4tn+6i5RrR+C464W7R39A8peRCPXpZHMX5Nfinl +# McxNzvCRdwxdwMcfAl5fbvKiHAMFVaJlU8YkDHxtshVTBTAdB5scvBwEfVBqTRgN +# Y3evpxNmLhQ49mbUo+IsGdgKb4wU3AOkvXBDIVg0/Ll+ +# SIG # End signature block diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml new file mode 100644 index 000000000000..95d6227f2ef8 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/[Content_Types].xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/_rels/.rels b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/_rels/.rels new file mode 100644 index 000000000000..95479a0e6d24 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/_rels/.rels @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt new file mode 100644 index 000000000000..7e294d272854 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/en-US/about_az.help.txt @@ -0,0 +1,50 @@ +About topic for Azure PowerShell - about_az + +TOPIC + +about_Az + +SHORT DESCRIPTION + +The Azure Az PowerShell module is a set of cmdlets for managing Azure +resources directly from the PowerShell command line and in PowerShell +scripts. + +LONG DESCRIPTION + +Azure PowerShell provides cross-platform cmdlets for managing Azure +services. All Azure PowerShell cmdlets work on Windows PowerShell 5.1 and +supported versions of PowerShell 7. + +The Azure PowerShell cmdlets follow the naming convention {verb}-Az{noun}. + +- {verb} is an approved PowerShell verb reflecting the corresponding HTTP + operation. + +- {noun} matches or has a close equivalent to the name of the resource. + +The cmdlets produce .NET objects that can be piped between commands +simplifying the sequencing of commands making Azure PowerShell a powerful +solution for scripting and automation purposes. + +A PowerShell module is available for each Azure service. For convenience, +we provide a wrapper module named "Az" that comprises the stable modules. +Modules in preview must be installed independently or via the "AzPreview" +wrapper module. + +Azure PowerShell is frequently updated to include bug fixes and service +updates. It is recommended to plan to update to the most recent version +regularly (a minimum of twice a year). + +GETTING STARTED + +1. Connect to Azure using Connect-AzAccount + +2. Run your first command. For example, create a resource group in the + east US region. + + New-AzResourceGroup -Name "MyResoureGroup" -location "eastus" + +SEE ALSO + +Azure PowerShell documentation: https://docs.microsoft.com/powershell/azure diff --git a/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp new file mode 100644 index 000000000000..5c37526de859 --- /dev/null +++ b/swaggerci/storage/generated/modules/Az.Accounts/2.7.5/package/services/metadata/core-properties/1aa0749a068a4238881858013f1a5b7f.psmdcp @@ -0,0 +1,11 @@ + + + Microsoft Corporation + Microsoft Azure PowerShell - Accounts credential management cmdlets for Azure Resource Manager in Windows PowerShell and PowerShell Core. + +For more information on account credential management, please visit the following: https://docs.microsoft.com/powershell/azure/authenticate-azureps + Az.Accounts + 2.7.5 + Azure ResourceManager ARM Accounts Authentication Environment Subscription PSModule PSIncludes_Cmdlet PSCmdlet_Disable-AzDataCollection PSCmdlet_Disable-AzContextAutosave PSCmdlet_Enable-AzDataCollection PSCmdlet_Enable-AzContextAutosave PSCmdlet_Remove-AzEnvironment PSCmdlet_Get-AzEnvironment PSCmdlet_Set-AzEnvironment PSCmdlet_Add-AzEnvironment PSCmdlet_Get-AzSubscription PSCmdlet_Connect-AzAccount PSCmdlet_Get-AzContext PSCmdlet_Set-AzContext PSCmdlet_Import-AzContext PSCmdlet_Save-AzContext PSCmdlet_Get-AzTenant PSCmdlet_Send-Feedback PSCmdlet_Resolve-AzError PSCmdlet_Select-AzContext PSCmdlet_Rename-AzContext PSCmdlet_Remove-AzContext PSCmdlet_Clear-AzContext PSCmdlet_Disconnect-AzAccount PSCmdlet_Get-AzContextAutosaveSetting PSCmdlet_Set-AzDefault PSCmdlet_Get-AzDefault PSCmdlet_Clear-AzDefault PSCmdlet_Register-AzModule PSCmdlet_Enable-AzureRmAlias PSCmdlet_Disable-AzureRmAlias PSCmdlet_Uninstall-AzureRm PSCmdlet_Invoke-AzRestMethod PSCmdlet_Get-AzAccessToken PSCmdlet_Open-AzSurveyLink PSCommand_Disable-AzDataCollection PSCommand_Disable-AzContextAutosave PSCommand_Enable-AzDataCollection PSCommand_Enable-AzContextAutosave PSCommand_Remove-AzEnvironment PSCommand_Get-AzEnvironment PSCommand_Set-AzEnvironment PSCommand_Add-AzEnvironment PSCommand_Get-AzSubscription PSCommand_Connect-AzAccount PSCommand_Get-AzContext PSCommand_Set-AzContext PSCommand_Import-AzContext PSCommand_Save-AzContext PSCommand_Get-AzTenant PSCommand_Send-Feedback PSCommand_Resolve-AzError PSCommand_Select-AzContext PSCommand_Rename-AzContext PSCommand_Remove-AzContext PSCommand_Clear-AzContext PSCommand_Disconnect-AzAccount PSCommand_Get-AzContextAutosaveSetting PSCommand_Set-AzDefault PSCommand_Get-AzDefault PSCommand_Clear-AzDefault PSCommand_Register-AzModule PSCommand_Enable-AzureRmAlias PSCommand_Disable-AzureRmAlias PSCommand_Uninstall-AzureRm PSCommand_Invoke-AzRestMethod PSCommand_Get-AzAccessToken PSCommand_Open-AzSurveyLink PSCommand_Add-AzAccount PSCommand_Login-AzAccount PSCommand_Remove-AzAccount PSCommand_Logout-AzAccount PSCommand_Select-AzSubscription PSCommand_Resolve-Error PSCommand_Save-AzProfile PSCommand_Get-AzDomain PSCommand_Invoke-AzRest + NuGet, Version=3.4.4.1321, Culture=neutral, PublicKeyToken=31bf3856ad364e35;Microsoft Windows NT 6.2.9200.0;.NET Framework 4.5 + \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/AsyncCommandRuntime.cs b/swaggerci/storage/generated/runtime/AsyncCommandRuntime.cs new file mode 100644 index 000000000000..9fdde1fbf3e8 --- /dev/null +++ b/swaggerci/storage/generated/runtime/AsyncCommandRuntime.cs @@ -0,0 +1,832 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + using System.Linq; + + internal interface IAsyncCommandRuntimeExtensions + { + Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep func); + System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs); + + T ExecuteSync(System.Func step); + } + + public class AsyncCommandRuntime : System.Management.Automation.ICommandRuntime2, IAsyncCommandRuntimeExtensions, System.IDisposable + { + private ICommandRuntime2 originalCommandRuntime; + private System.Threading.Thread originalThread; + public bool AllowInteractive { get; set; } = false; + + public CancellationToken cancellationToken; + SemaphoreSlim semaphore = new SemaphoreSlim(1, 1); + ManualResetEventSlim readyToRun = new ManualResetEventSlim(false); + ManualResetEventSlim completed = new ManualResetEventSlim(false); + + System.Action runOnMainThread; + + private System.Management.Automation.PSCmdlet cmdlet; + + internal AsyncCommandRuntime(System.Management.Automation.PSCmdlet cmdlet, CancellationToken cancellationToken) + { + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + this.cancellationToken = cancellationToken; + this.cmdlet = cmdlet; + if (cmdlet.PagingParameters != null) + { + WriteDebug("Client side pagination is enabled for this cmdlet"); + } + cmdlet.CommandRuntime = this; + } + + public PSHost Host => this.originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => this.originalCommandRuntime.CurrentPSTransaction; + + private void CheckForInteractive() + { + // This is an interactive call -- if we are not on the original thread, this will only work if this was done at ACR creation time; + if (!AllowInteractive) + { + throw new System.Exception("AsyncCommandRuntime is not configured for interactive calls"); + } + } + private void WaitOurTurn() + { + // wait for our turn to play + semaphore?.Wait(cancellationToken); + + // ensure that completed is not set + completed.Reset(); + } + + private void WaitForCompletion() + { + // wait for the result (or cancellation!) + WaitHandle.WaitAny(new[] { cancellationToken.WaitHandle, completed?.WaitHandle }); + + // let go of the semaphore + semaphore?.Release(); + + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, hasSecurityImpact, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldContinue(query, caption, ref yesToAll, ref noToAll); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool yta = yesToAll; + bool nta = noToAll; + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldContinue(query, caption, ref yta, ref nta); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + yesToAll = yta; + noToAll = nta; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string target, string action) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(target, action); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(target, action); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out shouldProcessReason); + } + + CheckForInteractive(); + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + ShouldProcessReason reason = ShouldProcessReason.None; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.ShouldProcess(verboseDescription, verboseWarning, caption, out reason); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + shouldProcessReason = reason; + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.ThrowTerminatingError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.ThrowTerminatingError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public bool TransactionAvailable() + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return originalCommandRuntime.TransactionAvailable(); + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + bool result = false; + + // set the function to run + runOnMainThread = () => result = originalCommandRuntime.TransactionAvailable(); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // set the output variables + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteCommandDetail(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteCommandDetail(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteCommandDetail(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteDebug(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteDebug(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteDebug(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteError(ErrorRecord errorRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteError(errorRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteError(errorRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteInformation(informationRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteInformation(informationRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteObject(sendToPipeline, enumerateCollection); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteProgress(sourceId, progressRecord); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteProgress(sourceId, progressRecord); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteVerbose(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteVerbose(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteVerbose(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void WriteWarning(string text) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + originalCommandRuntime.WriteWarning(text); + return; + } + + // otherwise, queue up the request and wait for the main thread to do the right thing. + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + + // set the function to run + runOnMainThread = () => originalCommandRuntime.WriteWarning(text); + + // tell the main thread to go ahead + readyToRun.Set(); + + // wait for the result (or cancellation!) + WaitForCompletion(); + + // return + return; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Wait(System.Threading.Tasks.Task ProcessRecordAsyncTask, System.Threading.CancellationToken cancellationToken) + { + do + { + WaitHandle.WaitAny(new[] { readyToRun.WaitHandle, ((System.IAsyncResult)ProcessRecordAsyncTask).AsyncWaitHandle }); + if (readyToRun.IsSet) + { + // reset the request for the next time + readyToRun.Reset(); + + // run the delegate on this thread + runOnMainThread(); + + // tell the originator everything is complete + completed.Set(); + } + } + while (!ProcessRecordAsyncTask.IsCompleted); + if (ProcessRecordAsyncTask.IsFaulted) + { + // don't unwrap a Aggregate Exception -- we'll lose the stack trace of the actual exception. + // if( ProcessRecordAsyncTask.Exception is System.AggregateException aggregate ) { + // throw aggregate.InnerException; + // } + throw ProcessRecordAsyncTask.Exception; + } + } + public Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep Wrap(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep func) => func.Target.GetType().Name != "Closure" ? func : (p1, p2, p3) => ExecuteSync>(() => func(p1, p2, p3)); + public System.Collections.Generic.IEnumerable Wrap(System.Collections.Generic.IEnumerable funcs) => funcs?.Select(Wrap); + + public T ExecuteSync(System.Func step) + { + // if we are on the original thread, just call straight thru. + if (this.originalThread == System.Threading.Thread.CurrentThread) + { + return step(); + } + + T result = default(T); + try + { + // wait for our turn to talk to the main thread + WaitOurTurn(); + // set the function to run + runOnMainThread = () => { result = step(); }; + // tell the main thread to go ahead + readyToRun.Set(); + // wait for the result (or cancellation!) + WaitForCompletion(); + // return + return result; + } + catch (System.OperationCanceledException exception) + { + // maybe don't even worry? + throw exception; + } + } + + public void Dispose() + { + if (cmdlet != null) + { + cmdlet.CommandRuntime = this.originalCommandRuntime; + cmdlet = null; + } + + semaphore?.Dispose(); + semaphore = null; + readyToRun?.Dispose(); + readyToRun = null; + completed?.Dispose(); + completed = null; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/AsyncJob.cs b/swaggerci/storage/generated/runtime/AsyncJob.cs new file mode 100644 index 000000000000..2a2229afe873 --- /dev/null +++ b/swaggerci/storage/generated/runtime/AsyncJob.cs @@ -0,0 +1,270 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + using System.Management.Automation; + using System.Management.Automation.Host; + using System.Threading; + + using System.Threading.Tasks; + + public class LongRunningJobCancelledException : System.Exception + { + public LongRunningJobCancelledException(string message) : base(message) + { + + } + } + + public class AsyncJob : Job, System.Management.Automation.ICommandRuntime2 + { + const int MaxRecords = 1000; + + private string _statusMessage = string.Empty; + + public override string StatusMessage => _statusMessage; + + public override bool HasMoreData => Output.Count > 0 || Progress.Count > 0 || Error.Count > 0 || Warning.Count > 0 || Verbose.Count > 0 || Debug.Count > 0; + + public override string Location => "localhost"; + + public PSHost Host => originalCommandRuntime.Host; + + public PSTransactionContext CurrentPSTransaction => originalCommandRuntime.CurrentPSTransaction; + + public override void StopJob() + { + Cancel(); + } + + private readonly PSCmdlet cmdlet; + private readonly ICommandRuntime2 originalCommandRuntime; + private readonly System.Threading.Thread originalThread; + + private void CheckForInteractive() + { + // This is an interactive call -- We should never allow interactivity in AsnycJob cmdlets. + throw new System.Exception("Cmdlets in AsyncJob; interactive calls are not permitted."); + } + private bool IsJobDone => CancellationToken.IsCancellationRequested || this.JobStateInfo.State == JobState.Failed || this.JobStateInfo.State == JobState.Stopped || this.JobStateInfo.State == JobState.Stopping || this.JobStateInfo.State == JobState.Completed; + + private readonly System.Action Cancel; + private readonly CancellationToken CancellationToken; + + internal AsyncJob(PSCmdlet cmdlet, string line, string name, CancellationToken cancellationToken, System.Action cancelMethod) : base(line, name) + { + SetJobState(JobState.NotStarted); + // know how to cancel/check for cancelation + this.CancellationToken = cancellationToken; + this.Cancel = cancelMethod; + + // we might need these. + this.originalCommandRuntime = cmdlet.CommandRuntime as ICommandRuntime2; + this.originalThread = System.Threading.Thread.CurrentThread; + + // the instance of the cmdlet we're going to run + this.cmdlet = cmdlet; + + // set the command runtime to the AsyncJob + cmdlet.CommandRuntime = this; + } + + /// + /// Monitors the task (which should be ProcessRecordAsync) to control + /// the lifetime of the job itself + /// + /// + public void Monitor(Task task) + { + SetJobState(JobState.Running); + task.ContinueWith(antecedent => + { + if (antecedent.IsCanceled) + { + // if the task was canceled, we're just going to call it completed. + SetJobState(JobState.Completed); + } + else if (antecedent.IsFaulted) + { + foreach (var innerException in antecedent.Exception.Flatten().InnerExceptions) + { + WriteError(new System.Management.Automation.ErrorRecord(innerException, string.Empty, System.Management.Automation.ErrorCategory.NotSpecified, null)); + } + + // a fault indicates an actual failure + SetJobState(JobState.Failed); + } + else + { + // otherwiser it's a completed state. + SetJobState(JobState.Completed); + } + }, CancellationToken); + } + + private void CheckForCancellation() + { + if (IsJobDone) + { + throw new LongRunningJobCancelledException("Long running job is canceled or stopping, continuation of the cmdlet is not permitted."); + } + } + + public void WriteInformation(InformationRecord informationRecord) + { + CheckForCancellation(); + + this.Information.Add(informationRecord); + } + + public bool ShouldContinue(string query, string caption, bool hasSecurityImpact, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public void WriteDebug(string text) + { + _statusMessage = text; + CheckForCancellation(); + + if (Debug.IsOpen && Debug.Count < MaxRecords) + { + Debug.Add(new DebugRecord(text)); + } + } + + public void WriteError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + + public void WriteObject(object sendToPipeline) + { + CheckForCancellation(); + + if (Output.IsOpen) + { + Output.Add(new PSObject(sendToPipeline)); + } + } + + public void WriteObject(object sendToPipeline, bool enumerateCollection) + { + CheckForCancellation(); + + if (enumerateCollection && sendToPipeline is System.Collections.IEnumerable enumerable) + { + foreach (var item in enumerable) + { + WriteObject(item); + } + } + else + { + WriteObject(sendToPipeline); + } + } + + public void WriteProgress(ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteProgress(long sourceId, ProgressRecord progressRecord) + { + CheckForCancellation(); + + if (Progress.IsOpen && Progress.Count < MaxRecords) + { + Progress.Add(progressRecord); + } + } + + public void WriteVerbose(string text) + { + CheckForCancellation(); + + if (Verbose.IsOpen && Verbose.Count < MaxRecords) + { + Verbose.Add(new VerboseRecord(text)); + } + } + + public void WriteWarning(string text) + { + CheckForCancellation(); + + if (Warning.IsOpen && Warning.Count < MaxRecords) + { + Warning.Add(new WarningRecord(text)); + } + } + + public void WriteCommandDetail(string text) + { + WriteVerbose(text); + } + + public bool ShouldProcess(string target) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string target, string action) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldProcess(string verboseDescription, string verboseWarning, string caption, out ShouldProcessReason shouldProcessReason) + { + CheckForInteractive(); + shouldProcessReason = ShouldProcessReason.None; + return false; + } + + public bool ShouldContinue(string query, string caption) + { + CheckForInteractive(); + return false; + } + + public bool ShouldContinue(string query, string caption, ref bool yesToAll, ref bool noToAll) + { + CheckForInteractive(); + return false; + } + + public bool TransactionAvailable() + { + // interactivity required? + return false; + } + + public void ThrowTerminatingError(ErrorRecord errorRecord) + { + if (Error.IsOpen) + { + Error.Add(errorRecord); + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/AsyncOperationResponse.cs b/swaggerci/storage/generated/runtime/AsyncOperationResponse.cs new file mode 100644 index 000000000000..a38205a69ab0 --- /dev/null +++ b/swaggerci/storage/generated/runtime/AsyncOperationResponse.cs @@ -0,0 +1,176 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + [System.ComponentModel.TypeConverter(typeof(AsyncOperationResponseTypeConverter))] + public class AsyncOperationResponse + { + private string _target; + public string Target { get => _target; set => _target = value; } + public AsyncOperationResponse() + { + } + internal AsyncOperationResponse(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json) + { + // pull target + { Target = If(json?.PropertyT("target"), out var _v) ? (string)_v : (string)Target; } + } + public string ToJsonString() + { + return $"{{ \"target\" : \"{this.Target}\" }}"; + } + + public static AsyncOperationResponse FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode node) + { + return node is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject json ? new AsyncOperationResponse(json) : null; + } + + + /// + /// Creates a new instance of , deserializing the content from a json string. + /// + /// a string containing a JSON serialized instance of this model. + /// an instance of the model class. + public static AsyncOperationResponse FromJsonString(string jsonText) => FromJson(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(jsonText)); + + } + + public partial class AsyncOperationResponseTypeConverter : System.Management.Automation.PSTypeConverter + { + + /// + /// Determines if the converter can convert the parameter to the + /// parameter. + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false. + /// + public override bool CanConvertFrom(object sourceValue, global::System.Type destinationType) => CanConvertFrom(sourceValue); + + /// + /// Determines if the converter can convert the parameter to a type + /// parameter. + /// + /// the instance to check if it can be converted to the type. + /// + /// true if the instance could be converted to a type, otherwise false + /// + public static bool CanConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return true; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + // we say yest to PSObjects + return true; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + // we say yest to Hashtables/dictionaries + return true; + } + try + { + if (null != sourceValue.ToJsonString()) + { + return true; + } + } + catch + { + // Not one of our objects + } + try + { + string text = sourceValue.ToString()?.Trim(); + return true == text?.StartsWith("{") && true == text?.EndsWith("}") && Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(text).Type == Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonType.Object; + } + catch + { + // Doesn't look like it can be treated as JSON + } + return false; + } + + /// + /// Determines if the parameter can be converted to the parameter + /// + /// the to convert from + /// the to convert to + /// + /// true if the converter can convert the parameter to the + /// parameter, otherwise false + /// + public override bool CanConvertTo(object sourceValue, global::System.Type destinationType) => false; + + /// + /// Converts the parameter to the parameter using and + /// + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// + /// an instance of , or null if there is no suitable conversion. + /// + public override object ConvertFrom(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Converts the parameter into an instance of + /// + /// the value to convert into an instance of . + /// + /// an instance of , or null if there is no suitable conversion. + /// + public static object ConvertFrom(dynamic sourceValue) + { + if (null == sourceValue) + { + return null; + } + global::System.Type type = sourceValue.GetType(); + if (typeof(AsyncOperationResponse).IsAssignableFrom(type)) + { + return sourceValue; + } + try + { + return AsyncOperationResponse.FromJsonString(typeof(string) == sourceValue.GetType() ? sourceValue : sourceValue.ToJsonString()); ; + } + catch + { + // Unable to use JSON pattern + } + + if (typeof(System.Management.Automation.PSObject).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as System.Management.Automation.PSObject).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + if (typeof(global::System.Collections.IDictionary).IsAssignableFrom(type)) + { + return new AsyncOperationResponse { Target = (sourceValue as global::System.Collections.IDictionary).GetValueForProperty("target", "", global::System.Convert.ToString) }; + } + return null; + } + + /// NotImplemented -- this will return null + /// the to convert from + /// the to convert to + /// not used by this TypeConverter. + /// when set to true, will ignore the case when converting. + /// will always return null. + public override object ConvertTo(object sourceValue, global::System.Type destinationType, global::System.IFormatProvider formatProvider, bool ignoreCase) => null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs new file mode 100644 index 000000000000..ae2348180e17 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportCmdletSurface.cs @@ -0,0 +1,113 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "CmdletSurface")] + [DoNotExport] + public class ExportCmdletSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CmdletFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool IncludeGeneralParameters { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetScriptCmdlets(this, CmdletFolder) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + foreach (var profileGroup in profileGroups) + { + var variantGroups = profileGroup.Variants + .GroupBy(v => new { v.CmdletName }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), String.Empty, profileGroup.ProfileName)); + var sb = UseExpandedFormat ? ExpandedFormat(variantGroups) : CondensedFormat(variantGroups); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, $"CmdletSurface-{profileGroup.ProfileName}.md"), sb.ToString()); + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private StringBuilder ExpandedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + foreach (var variantGroup in variantGroups.OrderBy(vg => vg.CmdletName)) + { + sb.Append($"### {variantGroup.CmdletName}{Environment.NewLine}"); + var parameterGroups = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private StringBuilder CondensedFormat(IEnumerable variantGroups) + { + var sb = new StringBuilder(); + var condensedGroups = variantGroups + .GroupBy(vg => vg.CmdletNoun) + .Select(vgg => ( + CmdletNoun: vgg.Key, + CmdletVerbs: vgg.Select(vg => vg.CmdletVerb).OrderBy(cv => cv).ToArray(), + ParameterGroups: vgg.SelectMany(vg => vg.ParameterGroups).DistinctBy(p => p.ParameterName).ToArray(), + OutputTypes: vgg.SelectMany(vg => vg.OutputTypes).Select(ot => ot.Type).DistinctBy(t => t.Name).Select(t => t.ToSyntaxTypeName()).ToArray())) + .OrderBy(vg => vg.CmdletNoun); + foreach (var condensedGroup in condensedGroups) + { + sb.Append($"### {condensedGroup.CmdletNoun} [{String.Join(", ", condensedGroup.CmdletVerbs)}] `{String.Join(", ", condensedGroup.OutputTypes)}`{Environment.NewLine}"); + var parameterGroups = condensedGroup.ParameterGroups + .Where(pg => !pg.DontShow && (IncludeGeneralParameters || (pg.OrderCategory != ParameterCategory.Azure && pg.OrderCategory != ParameterCategory.Runtime))); + foreach (var parameterGroup in parameterGroups) + { + sb.Append($" - {parameterGroup.ParameterName} `{parameterGroup.ParameterType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs new file mode 100644 index 000000000000..5044ed04c0e0 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportExampleStub.cs @@ -0,0 +1,74 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ExampleStub")] + [DoNotExport] + public class ExportExampleStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + + var exampleText = String.Join(String.Empty, DefaultExampleHelpInfos.Select(ehi => ehi.ToHelpExampleOutput())); + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var cmdletFilePaths = GetScriptCmdlets(exportDirectory).Select(fi => Path.Combine(outputFolder, $"{fi.Name}.md")).ToArray(); + var currentExamplesFilePaths = Directory.GetFiles(outputFolder).ToArray(); + // Remove examples of non-existing cmdlets + var removedCmdletFilePaths = currentExamplesFilePaths.Except(cmdletFilePaths); + foreach (var removedCmdletFilePath in removedCmdletFilePaths) + { + File.Delete(removedCmdletFilePath); + } + + // Only create example stubs if they don't exist + foreach (var cmdletFilePath in cmdletFilePaths.Except(currentExamplesFilePaths)) + { + File.WriteAllText(cmdletFilePath, exampleText); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs new file mode 100644 index 000000000000..028358ce3c35 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportFormatPs1xml.cs @@ -0,0 +1,101 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "FormatPs1xml")] + [DoNotExport] + public class ExportFormatPs1xml : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string FilePath { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Storage.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Storage.Support"; + private const string PropertiesExcludedForTableview = @""; + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + + protected override void ProcessRecord() + { + try + { + var viewModels = GetFilteredViewParameters().Select(CreateViewModel).ToList(); + var ps1xml = new Configuration + { + ViewDefinitions = new ViewDefinitions + { + Views = viewModels + } + }; + File.WriteAllText(FilePath, ps1xml.ToXmlString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static IEnumerable GetFilteredViewParameters() + { + //https://stackoverflow.com/a/79738/294804 + //https://stackoverflow.com/a/949285/294804 + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass + && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace)) + && !t.GetCustomAttributes().Any()); + return types.Select(t => new ViewParameters(t, t.GetProperties() + .Select(p => new PropertyFormat(p)) + .Where(pf => !pf.Property.GetCustomAttributes().Any() + && (!PropertiesExcludedForTableview.Split(',').Contains(pf.Property.Name)) + && (pf.FormatTable != null || (pf.Origin != PropertyOrigin.Inlined && pf.Property.PropertyType.IsPsSimple()))) + .OrderByDescending(pf => pf.Index.HasValue) + .ThenBy(pf => pf.Index) + .ThenByDescending(pf => pf.Origin.HasValue) + .ThenBy(pf => pf.Origin))).Where(vp => vp.Properties.Any()); + } + + private static View CreateViewModel(ViewParameters viewParameters) + { + var entries = viewParameters.Properties.Select(pf => + (TableColumnHeader: new TableColumnHeader { Label = pf.Label, Width = pf.Width }, + TableColumnItem: new TableColumnItem { PropertyName = pf.Property.Name })).ToArray(); + + return new View + { + Name = viewParameters.Type.FullName, + ViewSelectedBy = new ViewSelectedBy + { + TypeName = viewParameters.Type.FullName + }, + TableControl = new TableControl + { + TableHeaders = new TableHeaders + { + TableColumnHeaders = entries.Select(e => e.TableColumnHeader).ToList() + }, + TableRowEntries = new TableRowEntries + { + TableRowEntry = new TableRowEntry + { + TableColumnItems = new TableColumnItems + { + TableItems = entries.Select(e => e.TableColumnItem).ToList() + } + } + } + } + }; + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs new file mode 100644 index 000000000000..c2535af75b45 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportHelpMarkdown.cs @@ -0,0 +1,53 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.MarkdownRenderer; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "HelpMarkdown")] + [DoNotExport] + public class ExportHelpMarkdown : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSModuleInfo ModuleInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] FunctionInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSObject[] HelpInfo { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + protected override void ProcessRecord() + { + try + { + var helpInfos = HelpInfo.Select(hi => hi.ToPsHelpInfo()); + var variantGroups = FunctionInfo.Select(fi => fi.BaseObject).Cast() + .Join(helpInfos, fi => fi.Name, phi => phi.CmdletName, (fi, phi) => fi.ToVariants(phi)) + .Select(va => new VariantGroup(ModuleInfo.Name, va.First().CmdletName, va, String.Empty)); + WriteMarkdowns(variantGroups, ModuleInfo.ToModuleInfo(), DocsFolder, ExamplesFolder); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs new file mode 100644 index 000000000000..e509fa24f68f --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportModelSurface.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ModelSurface")] + [DoNotExport] + public class ExportModelSurface : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public bool UseExpandedFormat { get; set; } + + private const string ModelNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Storage.Models"; + private const string SupportNamespace = @"Microsoft.Azure.PowerShell.Cmdlets.Storage.Support"; + + protected override void ProcessRecord() + { + try + { + var types = Assembly.GetExecutingAssembly().GetExportedTypes() + .Where(t => t.IsClass && (t.Namespace.StartsWith(ModelNamespace) || t.Namespace.StartsWith(SupportNamespace))); + var typeInfos = types.Select(t => new ModelTypeInfo + { + Type = t, + TypeName = t.Name, + Properties = t.GetProperties(BindingFlags.Public | BindingFlags.Instance).Where(p => !p.GetIndexParameters().Any()).OrderBy(p => p.Name).ToArray(), + NamespaceGroup = t.Namespace.Split('.').LastOrDefault().EmptyIfNull() + }).Where(mti => mti.Properties.Any()); + var sb = UseExpandedFormat ? ExpandedFormat(typeInfos) : CondensedFormat(typeInfos); + Directory.CreateDirectory(OutputFolder); + File.WriteAllText(Path.Combine(OutputFolder, "ModelSurface.md"), sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + + private static StringBuilder ExpandedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + foreach (var typeInfo in typeInfos.OrderBy(mti => mti.TypeName).ThenBy(mti => mti.NamespaceGroup)) + { + sb.Append($"### {typeInfo.TypeName} [{typeInfo.NamespaceGroup}]{Environment.NewLine}"); + foreach (var property in typeInfo.Properties) + { + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}`{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + private static StringBuilder CondensedFormat(IEnumerable typeInfos) + { + var sb = new StringBuilder(); + var typeGroups = typeInfos + .GroupBy(mti => mti.TypeName) + .Select(tig => ( + Types: tig.Select(mti => mti.Type).ToArray(), + TypeName: tig.Key, + Properties: tig.SelectMany(mti => mti.Properties).DistinctBy(p => p.Name).OrderBy(p => p.Name).ToArray(), + NamespaceGroups: tig.Select(mti => mti.NamespaceGroup).OrderBy(ng => ng).ToArray() + )) + .OrderBy(tg => tg.TypeName); + foreach (var typeGroup in typeGroups) + { + var aType = typeGroup.Types.Select(GetAssociativeType).FirstOrDefault(t => t != null); + var aText = aType != null ? $@" \<{aType.ToSyntaxTypeName()}\>" : String.Empty; + sb.Append($"### {typeGroup.TypeName}{aText} [{String.Join(", ", typeGroup.NamespaceGroups)}]{Environment.NewLine}"); + foreach (var property in typeGroup.Properties) + { + var propertyAType = GetAssociativeType(property.PropertyType); + var propertyAText = propertyAType != null ? $" <{propertyAType.ToSyntaxTypeName()}>" : String.Empty; + var enumNames = GetEnumFieldNames(property.PropertyType.Unwrap()); + var enumNamesText = enumNames.Any() ? $" **{{{String.Join(", ", enumNames)}}}**" : String.Empty; + sb.Append($" - {property.Name} `{property.PropertyType.ToSyntaxTypeName()}{propertyAText}`{enumNamesText}{Environment.NewLine}"); + } + sb.AppendLine(); + } + + return sb; + } + + //https://stackoverflow.com/a/4963190/294804 + private static Type GetAssociativeType(Type type) => + type.GetInterfaces().FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>))?.GetGenericArguments().First(); + + private static string[] GetEnumFieldNames(Type type) => + type.IsValueType && !type.IsPrimitive && type != typeof(decimal) && type != typeof(DateTime) + ? type.GetFields(BindingFlags.Public | BindingFlags.Static).Where(f => f.FieldType == type).Select(p => p.Name).ToArray() + : new string[] { }; + + private class ModelTypeInfo + { + public Type Type { get; set; } + public string TypeName { get; set; } + public PropertyInfo[] Properties { get; set; } + public string NamespaceGroup { get; set; } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs new file mode 100644 index 000000000000..00b6ef5c2c52 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportProxyCmdlet.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpers; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.MarkdownRenderer; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsProxyTypeExtensions; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "ProxyCmdlet", DefaultParameterSetName = "Docs")] + [DoNotExport] + public class ExportProxyCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string[] ModulePath { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string InternalFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [AllowEmptyString] + public string ModuleDescription { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + [ValidateNotNullOrEmpty] + public string DocsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExamplesFolder { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "Docs")] + public Guid ModuleGuid { get; set; } + + [Parameter(Mandatory = true, ParameterSetName = "NoDocs")] + public SwitchParameter ExcludeDocs { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = GetModuleCmdletsAndHelpInfo(this, ModulePath).SelectMany(ci => ci.ToVariants()).Where(v => !v.IsDoNotExport).ToArray(); + var allProfiles = variants.SelectMany(v => v.Profiles).Distinct().ToArray(); + var profileGroups = allProfiles.Any() + ? variants + .SelectMany(v => (v.Profiles.Any() ? v.Profiles : allProfiles).Select(p => (profile: p, variant: v))) + .GroupBy(pv => pv.profile) + .Select(pvg => new ProfileGroup(pvg.Select(pv => pv.variant).ToArray(), pvg.Key)) + : new[] { new ProfileGroup(variants) }; + var variantGroups = profileGroups.SelectMany(pg => pg.Variants + .GroupBy(v => new { v.CmdletName, v.IsInternal }) + .Select(vg => new VariantGroup(ModuleName, vg.Key.CmdletName, vg.Select(v => v).ToArray(), + Path.Combine(vg.Key.IsInternal ? InternalFolder : ExportsFolder, pg.ProfileFolder), pg.ProfileName, isInternal: vg.Key.IsInternal))) + .ToArray(); + + var license = new StringBuilder(); + license.Append(@" +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +"); + HashSet LicenseSet = new HashSet(); + foreach (var variantGroup in variantGroups) + { + var parameterGroups = variantGroup.ParameterGroups.ToList(); + var isValidProfile = !String.IsNullOrEmpty(variantGroup.ProfileName) && variantGroup.ProfileName != NoProfiles; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, variantGroup.ProfileName) : ExamplesFolder; + var markdownInfo = new MarkdownHelpInfo(variantGroup, examplesFolder); + List examples = new List(); + foreach (var it in markdownInfo.Examples) + { + examples.Add(it); + } + variantGroup.HelpInfo.Examples = examples.ToArray(); + var sb = new StringBuilder(); + sb.Append($"{Environment.NewLine}"); + sb.Append(variantGroup.ToHelpCommentOutput()); + sb.Append($"function {variantGroup.CmdletName} {{{Environment.NewLine}"); + sb.Append(variantGroup.Aliases.ToAliasOutput()); + sb.Append(variantGroup.OutputTypes.ToOutputTypeOutput()); + sb.Append(variantGroup.ToCmdletBindingOutput()); + sb.Append(variantGroup.ProfileName.ToProfileOutput()); + + sb.Append("param("); + sb.Append($"{(parameterGroups.Any() ? Environment.NewLine : String.Empty)}"); + foreach (var parameterGroup in parameterGroups) + { + var parameters = parameterGroup.HasAllVariants ? parameterGroup.Parameters.Take(1) : parameterGroup.Parameters; + parameters = parameters.Where(p => !p.IsHidden()); + if (!parameters.Any()) + { + continue; + } + foreach (var parameter in parameters) + { + sb.Append(parameter.ToParameterOutput(variantGroup.HasMultipleVariants, parameterGroup.HasAllVariants)); + } + sb.Append(parameterGroup.Aliases.ToAliasOutput(true)); + sb.Append(parameterGroup.HasValidateNotNull.ToValidateNotNullOutput()); + sb.Append(parameterGroup.HasAllowEmptyArray.ToAllowEmptyArray()); + sb.Append(parameterGroup.CompleterInfo.ToArgumentCompleterOutput()); + sb.Append(parameterGroup.OrderCategory.ToParameterCategoryOutput()); + sb.Append(parameterGroup.InfoAttribute.ToInfoOutput(parameterGroup.ParameterType)); + sb.Append(parameterGroup.ToDefaultInfoOutput()); + sb.Append(parameterGroup.ParameterType.ToParameterTypeOutput()); + sb.Append(parameterGroup.Description.ToParameterDescriptionOutput()); + sb.Append(parameterGroup.ParameterName.ToParameterNameOutput(parameterGroups.IndexOf(parameterGroup) == parameterGroups.Count - 1)); + } + sb.Append($"){Environment.NewLine}{Environment.NewLine}"); + + sb.Append(variantGroup.ToBeginOutput()); + sb.Append(variantGroup.ToProcessOutput()); + sb.Append(variantGroup.ToEndOutput()); + + sb.Append($"}}{Environment.NewLine}"); + + Directory.CreateDirectory(variantGroup.OutputFolder); + File.WriteAllText(variantGroup.FilePath, license.ToString()); + File.AppendAllText(variantGroup.FilePath, sb.ToString()); + if (!LicenseSet.Contains(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"))) + { + // only add license in the header + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), license.ToString()); + LicenseSet.Add(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1")); + } + File.AppendAllText(Path.Combine(variantGroup.OutputFolder, "ProxyCmdletDefinitions.ps1"), sb.ToString()); + } + + if (!ExcludeDocs) + { + var moduleInfo = new PsModuleHelpInfo(ModuleName, ModuleGuid, ModuleDescription); + foreach (var variantGroupsByProfile in variantGroups.GroupBy(vg => vg.ProfileName)) + { + var profileName = variantGroupsByProfile.Key; + var isValidProfile = !String.IsNullOrEmpty(profileName) && profileName != NoProfiles; + var docsFolder = isValidProfile ? Path.Combine(DocsFolder, profileName) : DocsFolder; + var examplesFolder = isValidProfile ? Path.Combine(ExamplesFolder, profileName) : ExamplesFolder; + WriteMarkdowns(variantGroupsByProfile, moduleInfo, docsFolder, examplesFolder); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs new file mode 100644 index 000000000000..58db26712e51 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportPsd1.cs @@ -0,0 +1,191 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "Psd1")] + [DoNotExport] + public class ExportPsd1 : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string CustomFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + [Parameter(Mandatory = true)] + public Guid ModuleGuid { get; set; } + + private static readonly bool IsAzure = Convert.ToBoolean(@"true"); + private const string CustomFolderRelative = "./custom"; + private const string Indent = Psd1Indent; + private const string Undefined = "undefined"; + private bool IsUndefined(string value) => string.Equals(Undefined, value, StringComparison.OrdinalIgnoreCase); + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + if (!Directory.Exists(CustomFolder)) + { + throw new ArgumentException($"Custom folder '{CustomFolder}' does not exist"); + } + + string version = Convert.ToString(@"0.1.0"); + // Validate the module version should be semantic version + // Following regex is official from https://semver.org/ + Regex rx = new Regex(@"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$", RegexOptions.Compiled); + if (rx.Matches(version).Count != 1) + { + throw new ArgumentException("Module-version is not a valid Semantic Version"); + } + + string previewVersion = null; + if (version.Contains('-')) + { + string[] versions = version.Split("-".ToCharArray(), 2); + version = versions[0]; + previewVersion = versions[1]; + } + + var sb = new StringBuilder(); + sb.AppendLine("@{"); + sb.AppendLine($@"{GuidStart} = '{ModuleGuid}'"); + sb.AppendLine($@"{Indent}RootModule = '{"./Az.Storage.psm1"}'"); + sb.AppendLine($@"{Indent}ModuleVersion = '{version}'"); + sb.AppendLine($@"{Indent}CompatiblePSEditions = 'Core', 'Desktop'"); + sb.AppendLine($@"{Indent}Author = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}CompanyName = '{"Microsoft Corporation"}'"); + sb.AppendLine($@"{Indent}Copyright = '{"Microsoft Corporation. All rights reserved."}'"); + sb.AppendLine($@"{Indent}Description = '{"Microsoft Azure PowerShell: Storage cmdlets"}'"); + sb.AppendLine($@"{Indent}PowerShellVersion = '5.1'"); + sb.AppendLine($@"{Indent}DotNetFrameworkVersion = '4.7.2'"); + + // RequiredModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredModules = @({"undefined"})"); + } + + // RequiredAssemblies + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}RequiredAssemblies = @({"undefined"})"); + } + else + { + sb.AppendLine($@"{Indent}RequiredAssemblies = '{"./bin/Az.Storage.private.dll"}'"); + } + + // NestedModules + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}NestedModules = @({"undefined"})"); + } + + // FormatsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FormatsToProcess = @({"undefined"})"); + } + else + { + var customFormatPs1xmlFiles = Directory.GetFiles(CustomFolder) + .Where(f => f.EndsWith(".format.ps1xml")) + .Select(f => $"{CustomFolderRelative}/{Path.GetFileName(f)}"); + var formatList = customFormatPs1xmlFiles.Prepend("./Az.Storage.format.ps1xml").ToPsList(); + sb.AppendLine($@"{Indent}FormatsToProcess = {formatList}"); + } + + // TypesToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}TypesToProcess = @({"undefined"})"); + } + + // ScriptsToProcess + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}ScriptsToProcess = @({"undefined"})"); + } + + var functionInfos = GetScriptCmdlets(ExportsFolder).ToArray(); + // FunctionsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}FunctionsToExport = @({"undefined"})"); + } + else + { + var cmdletsList = functionInfos.Select(fi => fi.Name).Distinct().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}FunctionsToExport = {cmdletsList}"); + } + + // AliasesToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}AliasesToExport = @({"undefined"})"); + } + else + { + var aliasesList = functionInfos.SelectMany(fi => fi.ScriptBlock.Attributes).ToAliasNames().Append("*").ToPsList(); + sb.AppendLine($@"{Indent}AliasesToExport = {aliasesList}"); + } + + // CmdletsToExport + if (!IsUndefined("undefined")) + { + sb.AppendLine($@"{Indent}CmdletsToExport = @({"undefined"})"); + } + + sb.AppendLine($@"{Indent}PrivateData = @{{"); + sb.AppendLine($@"{Indent}{Indent}PSData = @{{"); + + if (previewVersion != null) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Prerelease = {previewVersion}"); + } + sb.AppendLine($@"{Indent}{Indent}{Indent}Tags = {"Azure ResourceManager ARM PSModule Storage".Split(' ').ToPsList().NullIfEmpty() ?? "''"}"); + sb.AppendLine($@"{Indent}{Indent}{Indent}LicenseUri = '{"https://aka.ms/azps-license"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ProjectUri = '{"https://github.com/Azure/azure-powershell"}'"); + sb.AppendLine($@"{Indent}{Indent}{Indent}ReleaseNotes = ''"); + var profilesList = ""; + if (IsAzure && !String.IsNullOrEmpty(profilesList)) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}Profiles = {profilesList}"); + } + + sb.AppendLine($@"{Indent}{Indent}}}"); + sb.AppendLine($@"{Indent}}}"); + sb.AppendLine(@"}"); + + File.WriteAllText(Psd1Path, sb.ToString()); + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs new file mode 100644 index 000000000000..a3341f228cd6 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/ExportTestStub.cs @@ -0,0 +1,148 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsData.Export, "TestStub")] + [DoNotExport] + public class ExportTestStub : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ModuleName { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ExportsFolder { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string OutputFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeGenerated { get; set; } + + protected override void ProcessRecord() + { + try + { + if (!Directory.Exists(ExportsFolder)) + { + throw new ArgumentException($"Exports folder '{ExportsFolder}' does not exist"); + } + + var exportDirectories = Directory.GetDirectories(ExportsFolder); + if (!exportDirectories.Any()) + { + exportDirectories = new[] { ExportsFolder }; + } + var utilFile = Path.Combine(OutputFolder, "utils.ps1"); + if (!File.Exists(utilFile)) + { + var sc = new StringBuilder(); + sc.AppendLine(@"function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} +"); + File.WriteAllText(utilFile, sc.ToString()); + } + foreach (var exportDirectory in exportDirectories) + { + var outputFolder = OutputFolder; + if (exportDirectory != ExportsFolder) + { + outputFolder = Path.Combine(OutputFolder, Path.GetFileName(exportDirectory)); + Directory.CreateDirectory(outputFolder); + } + + var variantGroups = GetScriptCmdlets(exportDirectory) + .SelectMany(fi => fi.ToVariants()) + .Where(v => !v.IsDoNotExport) + .GroupBy(v => v.CmdletName) + .Select(vg => new VariantGroup(ModuleName, vg.Key, vg.Select(v => v).ToArray(), outputFolder, isTest: true)) + .Where(vtg => !File.Exists(vtg.FilePath) && (IncludeGenerated || !vtg.IsGenerated)); + + foreach (var variantGroup in variantGroups) + { + var sb = new StringBuilder(); + sb.AppendLine($"if(($null -eq $TestName) -or ($TestName -contains '{variantGroup.CmdletName}'))"); + sb.AppendLine(@"{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath)" +); + sb.AppendLine($@" $TestRecordingFile = Join-Path $PSScriptRoot '{variantGroup.CmdletName}.Recording.json'"); + sb.AppendLine(@" $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} +"); + + + sb.AppendLine($"Describe '{variantGroup.CmdletName}' {{"); + var variants = variantGroup.Variants + .Where(v => IncludeGenerated || !v.Attributes.OfType().Any()) + .ToList(); + + foreach (var variant in variants) + { + sb.AppendLine($"{Indent}It '{variant.VariantName}' -skip {{"); + sb.AppendLine($"{Indent}{Indent}{{ throw [System.NotImplementedException] }} | Should -Not -Throw"); + var variantSeparator = variants.IndexOf(variant) == variants.Count - 1 ? String.Empty : Environment.NewLine; + sb.AppendLine($"{Indent}}}{variantSeparator}"); + } + sb.AppendLine("}"); + + File.WriteAllText(variantGroup.FilePath, sb.ToString()); + } + } + } + catch (Exception ee) + { + Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs new file mode 100644 index 000000000000..9cdc213c4feb --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetCommonParameter.cs @@ -0,0 +1,52 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "CommonParameter")] + [OutputType(typeof(Dictionary))] + [DoNotExport] + public class GetCommonParameter : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public PSCmdlet PSCmdlet { get; set; } + + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public Dictionary PSBoundParameter { get; set; } + + protected override void ProcessRecord() + { + try + { + var variants = PSCmdlet.MyInvocation.MyCommand.ToVariants(); + var commonParameterNames = variants.ToParameterGroups() + .Where(pg => pg.OrderCategory == ParameterCategory.Azure || pg.OrderCategory == ParameterCategory.Runtime) + .Select(pg => pg.ParameterName); + if (variants.Any(v => v.SupportsShouldProcess)) + { + commonParameterNames = commonParameterNames.Append("Confirm").Append("WhatIf"); + } + if (variants.Any(v => v.SupportsPaging)) + { + commonParameterNames = commonParameterNames.Append("First").Append("Skip").Append("IncludeTotalCount"); + } + + var names = commonParameterNames.ToArray(); + var keys = PSBoundParameter.Keys.Where(k => names.Contains(k)); + WriteObject(keys.ToDictionary(key => key, key => PSBoundParameter[key]), true); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs new file mode 100644 index 000000000000..16225b521623 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetModuleGuid.cs @@ -0,0 +1,31 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ModuleGuid")] + [DoNotExport] + public class GetModuleGuid : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string Psd1Path { get; set; } + + protected override void ProcessRecord() + { + try + { + WriteObject(ReadGuidFromPsd1(Psd1Path)); + } + catch (System.Exception ee) + { + System.Console.WriteLine($"${ee.GetType().Name}/{ee.StackTrace}"); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs new file mode 100644 index 000000000000..75cae93cc869 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Cmdlets/GetScriptCmdlet.cs @@ -0,0 +1,54 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpers; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + [Cmdlet(VerbsCommon.Get, "ScriptCmdlet")] + [OutputType(typeof(string[]))] + [DoNotExport] + public class GetScriptCmdlet : PSCmdlet + { + [Parameter(Mandatory = true)] + [ValidateNotNullOrEmpty] + public string ScriptFolder { get; set; } + + [Parameter] + public SwitchParameter IncludeDoNotExport { get; set; } + + [Parameter] + public SwitchParameter AsAlias { get; set; } + + [Parameter] + public SwitchParameter AsFunctionInfo { get; set; } + + protected override void ProcessRecord() + { + try + { + var functionInfos = GetScriptCmdlets(this, ScriptFolder) + .Where(fi => IncludeDoNotExport || !fi.ScriptBlock.Attributes.OfType().Any()) + .ToArray(); + if (AsFunctionInfo) + { + WriteObject(functionInfos, true); + return; + } + var aliases = functionInfos.SelectMany(i => i.ScriptBlock.Attributes).ToAliasNames(); + var names = functionInfos.Select(fi => fi.Name).Distinct(); + var output = (AsAlias ? aliases : names).DefaultIfEmpty("''").ToArray(); + WriteObject(output, true); + } + catch (System.Exception ee) + { + System.Console.Error.WriteLine($"{ee.GetType().Name}: {ee.Message}"); + System.Console.Error.WriteLine(ee.StackTrace); + throw ee; + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/CollectionExtensions.cs b/swaggerci/storage/generated/runtime/BuildTime/CollectionExtensions.cs new file mode 100644 index 000000000000..3e49e35e8410 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/CollectionExtensions.cs @@ -0,0 +1,20 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal static class CollectionExtensions + { + public static T[] NullIfEmpty(this T[] collection) => (collection?.Any() ?? false) ? collection : null; + public static IEnumerable EmptyIfNull(this IEnumerable collection) => collection ?? Enumerable.Empty(); + + // https://stackoverflow.com/a/4158364/294804 + public static IEnumerable DistinctBy(this IEnumerable collection, Func selector) => + collection.GroupBy(selector).Select(group => group.First()); + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/MarkdownRenderer.cs b/swaggerci/storage/generated/runtime/BuildTime/MarkdownRenderer.cs new file mode 100644 index 000000000000..2e0947bf9ef9 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/MarkdownRenderer.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Text; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsProxyOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal static class MarkdownRenderer + { + public static void WriteMarkdowns(IEnumerable variantGroups, PsModuleHelpInfo moduleHelpInfo, string docsFolder, string examplesFolder) + { + Directory.CreateDirectory(docsFolder); + var markdownInfos = variantGroups.Where(vg => !vg.IsInternal).Select(vg => new MarkdownHelpInfo(vg, examplesFolder)).OrderBy(mhi => mhi.CmdletName).ToArray(); + + foreach (var markdownInfo in markdownInfos) + { + var sb = new StringBuilder(); + sb.Append(markdownInfo.ToHelpMetadataOutput()); + sb.Append($"# {markdownInfo.CmdletName}{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"## SYNOPSIS{Environment.NewLine}{markdownInfo.Synopsis.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## SYNTAX{Environment.NewLine}{Environment.NewLine}"); + var hasMultipleParameterSets = markdownInfo.SyntaxInfos.Length > 1; + foreach (var syntaxInfo in markdownInfo.SyntaxInfos) + { + sb.Append(syntaxInfo.ToHelpSyntaxOutput(hasMultipleParameterSets)); + } + + sb.Append($"## DESCRIPTION{Environment.NewLine}{markdownInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## EXAMPLES{Environment.NewLine}{Environment.NewLine}"); + foreach (var exampleInfo in markdownInfo.Examples) + { + sb.Append(exampleInfo.ToHelpExampleOutput()); + } + + sb.Append($"## PARAMETERS{Environment.NewLine}{Environment.NewLine}"); + foreach (var parameter in markdownInfo.Parameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + if (markdownInfo.SupportsShouldProcess) + { + foreach (var parameter in SupportsShouldProcessParameters) + { + sb.Append(parameter.ToHelpParameterOutput()); + } + } + + sb.Append($"### CommonParameters{Environment.NewLine}This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see [about_CommonParameters](http://go.microsoft.com/fwlink/?LinkID=113216).{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## INPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var input in markdownInfo.Inputs) + { + sb.Append($"### {input}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## OUTPUTS{Environment.NewLine}{Environment.NewLine}"); + foreach (var output in markdownInfo.Outputs) + { + sb.Append($"### {output}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## NOTES{Environment.NewLine}{Environment.NewLine}"); + sb.Append($"ALIASES{Environment.NewLine}{Environment.NewLine}"); + foreach (var alias in markdownInfo.Aliases) + { + sb.Append($"{alias}{Environment.NewLine}{Environment.NewLine}"); + } + if (markdownInfo.ComplexInterfaceInfos.Any()) + { + sb.Append($"{ComplexParameterHeader}{Environment.NewLine}"); + } + foreach (var complexInterfaceInfo in markdownInfo.ComplexInterfaceInfos) + { + sb.Append($"{complexInterfaceInfo.ToNoteOutput(includeDashes: true, includeBackticks: true)}{Environment.NewLine}{Environment.NewLine}"); + } + + sb.Append($"## RELATED LINKS{Environment.NewLine}{Environment.NewLine}"); + foreach (var relatedLink in markdownInfo.RelatedLinks) + { + sb.Append($"{relatedLink}{Environment.NewLine}{Environment.NewLine}"); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{markdownInfo.CmdletName}.md"), sb.ToString()); + } + + WriteModulePage(moduleHelpInfo, markdownInfos, docsFolder); + } + + private static void WriteModulePage(PsModuleHelpInfo moduleInfo, MarkdownHelpInfo[] markdownInfos, string docsFolder) + { + var sb = new StringBuilder(); + sb.Append(moduleInfo.ToModulePageMetadataOutput()); + sb.Append($"# {moduleInfo.Name} Module{Environment.NewLine}"); + sb.Append($"## Description{Environment.NewLine}{moduleInfo.Description.ToDescriptionFormat()}{Environment.NewLine}{Environment.NewLine}"); + + sb.Append($"## {moduleInfo.Name} Cmdlets{Environment.NewLine}"); + foreach (var markdownInfo in markdownInfos) + { + sb.Append(markdownInfo.ToModulePageCmdletOutput()); + } + + File.WriteAllText(Path.Combine(docsFolder, $"{moduleInfo.Name}.md"), sb.ToString()); + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Models/PsFormatTypes.cs b/swaggerci/storage/generated/runtime/BuildTime/Models/PsFormatTypes.cs new file mode 100644 index 000000000000..cdd53f584a12 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Models/PsFormatTypes.cs @@ -0,0 +1,138 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal class ViewParameters + { + public Type Type { get; } + public IEnumerable Properties { get; } + + public ViewParameters(Type type, IEnumerable properties) + { + Type = type; + Properties = properties; + } + } + + internal class PropertyFormat + { + public PropertyInfo Property { get; } + public FormatTableAttribute FormatTable { get; } + + public int? Index { get; } + public string Label { get; } + public int? Width { get; } + public PropertyOrigin? Origin { get; } + + public PropertyFormat(PropertyInfo propertyInfo) + { + Property = propertyInfo; + FormatTable = Property.GetCustomAttributes().FirstOrDefault(); + var origin = Property.GetCustomAttributes().FirstOrDefault(); + + Index = FormatTable?.HasIndex ?? false ? (int?)FormatTable.Index : null; + Label = FormatTable?.Label ?? propertyInfo.Name; + Width = FormatTable?.HasWidth ?? false ? (int?)FormatTable.Width : null; + // If we have an index, we don't want to use Origin. + Origin = FormatTable?.HasIndex ?? false ? null : origin?.Origin; + } + } + + [Serializable] + [XmlRoot(nameof(Configuration))] + public class Configuration + { + [XmlElement("ViewDefinitions")] + public ViewDefinitions ViewDefinitions { get; set; } + } + + [Serializable] + public class ViewDefinitions + { + //https://stackoverflow.com/a/10518657/294804 + [XmlElement("View")] + public List Views { get; set; } + } + + [Serializable] + public class View + { + [XmlElement(nameof(Name))] + public string Name { get; set; } + [XmlElement(nameof(ViewSelectedBy))] + public ViewSelectedBy ViewSelectedBy { get; set; } + [XmlElement(nameof(TableControl))] + public TableControl TableControl { get; set; } + } + + [Serializable] + public class ViewSelectedBy + { + [XmlElement(nameof(TypeName))] + public string TypeName { get; set; } + } + + [Serializable] + public class TableControl + { + [XmlElement(nameof(TableHeaders))] + public TableHeaders TableHeaders { get; set; } + [XmlElement(nameof(TableRowEntries))] + public TableRowEntries TableRowEntries { get; set; } + } + + [Serializable] + public class TableHeaders + { + [XmlElement("TableColumnHeader")] + public List TableColumnHeaders { get; set; } + } + + [Serializable] + public class TableColumnHeader + { + [XmlElement(nameof(Label))] + public string Label { get; set; } + [XmlElement(nameof(Width))] + public int? Width { get; set; } + + //https://stackoverflow.com/a/4095225/294804 + public bool ShouldSerializeWidth() => Width.HasValue; + } + + [Serializable] + public class TableRowEntries + { + [XmlElement(nameof(TableRowEntry))] + public TableRowEntry TableRowEntry { get; set; } + } + + [Serializable] + public class TableRowEntry + { + [XmlElement(nameof(TableColumnItems))] + public TableColumnItems TableColumnItems { get; set; } + } + + [Serializable] + public class TableColumnItems + { + [XmlElement("TableColumnItem")] + public List TableItems { get; set; } + } + + [Serializable] + public class TableColumnItem + { + [XmlElement(nameof(PropertyName))] + public string PropertyName { get; set; } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs b/swaggerci/storage/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs new file mode 100644 index 000000000000..dc2816363081 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Models/PsHelpMarkdownOutputs.cs @@ -0,0 +1,199 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal class HelpMetadataOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public HelpMetadataOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"--- +external help file:{(!String.IsNullOrEmpty(HelpInfo.ExternalHelpFilename) ? $" {HelpInfo.ExternalHelpFilename}" : String.Empty)} +Module Name: {HelpInfo.ModuleName} +online version: {HelpInfo.OnlineVersion} +schema: {HelpInfo.Schema.ToString(3)} +--- + +"; + } + + internal class HelpSyntaxOutput + { + public MarkdownSyntaxHelpInfo SyntaxInfo { get; } + public bool HasMultipleParameterSets { get; } + + public HelpSyntaxOutput(MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) + { + SyntaxInfo = syntaxInfo; + HasMultipleParameterSets = hasMultipleParameterSets; + } + + public override string ToString() + { + var psnText = HasMultipleParameterSets ? $"### {SyntaxInfo.ParameterSetName}{(SyntaxInfo.IsDefault ? " (Default)" : String.Empty)}{Environment.NewLine}" : String.Empty; + return $@"{psnText}``` +{SyntaxInfo.SyntaxText} +``` + +"; + } + } + + internal class HelpExampleOutput + { + private string ExampleTemplate = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + Environment.NewLine; + + private string ExampleTemplateWithOutput = + "{0}{1}" + Environment.NewLine + + "{2}" + Environment.NewLine + "{3}" + Environment.NewLine + "{4}" + Environment.NewLine + Environment.NewLine + + "{5}" + Environment.NewLine + "{6}" + Environment.NewLine + "{7}" + Environment.NewLine + Environment.NewLine + + "{8}" + Environment.NewLine + Environment.NewLine; + + public MarkdownExampleHelpInfo ExampleInfo { get; } + + public HelpExampleOutput(MarkdownExampleHelpInfo exampleInfo) + { + ExampleInfo = exampleInfo; + } + + public override string ToString() + { + if (string.IsNullOrEmpty(ExampleInfo.Output)) + { + return string.Format(ExampleTemplate, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleInfo.Description.ToDescriptionFormat()); + } + else + { + return string.Format(ExampleTemplateWithOutput, + ExampleNameHeader, ExampleInfo.Name, + ExampleCodeHeader, ExampleInfo.Code, ExampleCodeFooter, + ExampleOutputHeader, ExampleInfo.Output, ExampleOutputFooter, + ExampleInfo.Description.ToDescriptionFormat()); ; + } + } + } + + internal class HelpParameterOutput + { + public MarkdownParameterHelpInfo ParameterInfo { get; } + + public HelpParameterOutput(MarkdownParameterHelpInfo parameterInfo) + { + ParameterInfo = parameterInfo; + } + + public override string ToString() + { + var pipelineInputTypes = new[] + { + ParameterInfo.AcceptsPipelineByValue ? "ByValue" : String.Empty, + ParameterInfo.AcceptsPipelineByPropertyName ? "ByPropertyName" : String.Empty + }.JoinIgnoreEmpty(", "); + var pipelineInput = ParameterInfo.AcceptsPipelineByValue || ParameterInfo.AcceptsPipelineByPropertyName + ? $@"{true} ({pipelineInputTypes})" + : false.ToString(); + + return $@"### -{ParameterInfo.Name} +{ParameterInfo.Description.ToDescriptionFormat()} + +```yaml +Type: {ParameterInfo.Type.FullName} +Parameter Sets: {(ParameterInfo.HasAllParameterSets ? "(All)" : ParameterInfo.ParameterSetNames.JoinIgnoreEmpty(", "))} +Aliases:{(ParameterInfo.Aliases.Any() ? $" {ParameterInfo.Aliases.JoinIgnoreEmpty(", ")}" : String.Empty)} + +Required: {ParameterInfo.IsRequired} +Position: {ParameterInfo.Position} +Default value: {ParameterInfo.DefaultValue} +Accept pipeline input: {pipelineInput} +Accept wildcard characters: {ParameterInfo.AcceptsWildcardCharacters} +``` + +"; + } + } + + internal class ModulePageMetadataOutput + { + public PsModuleHelpInfo ModuleInfo { get; } + + private static string HelpLinkPrefix { get; } = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public ModulePageMetadataOutput(PsModuleHelpInfo moduleInfo) + { + ModuleInfo = moduleInfo; + } + + public override string ToString() => $@"--- +Module Name: {ModuleInfo.Name} +Module Guid: {ModuleInfo.Guid} +Download Help Link: {HelpLinkPrefix}{ModuleInfo.Name.ToLowerInvariant()} +Help Version: 1.0.0.0 +Locale: en-US +--- + +"; + } + + internal class ModulePageCmdletOutput + { + public MarkdownHelpInfo HelpInfo { get; } + + public ModulePageCmdletOutput(MarkdownHelpInfo helpInfo) + { + HelpInfo = helpInfo; + } + + public override string ToString() => $@"### [{HelpInfo.CmdletName}]({HelpInfo.CmdletName}.md) +{HelpInfo.Synopsis.ToDescriptionFormat()} + +"; + } + + internal static class PsHelpOutputExtensions + { + public static string EscapeAngleBrackets(this string text) => text?.Replace("<", @"\<").Replace(">", @"\>"); + public static string ReplaceSentenceEndWithNewline(this string text) => text?.Replace(". ", $".{Environment.NewLine}").Replace(". ", $".{Environment.NewLine}"); + public static string ReplaceBrWithNewline(this string text) => text?.Replace("
", $"{Environment.NewLine}"); + public static string ToDescriptionFormat(this string text, bool escapeAngleBrackets = true) + { + var description = text?.ReplaceBrWithNewline(); + description = escapeAngleBrackets ? description?.EscapeAngleBrackets() : description; + return description?.ReplaceSentenceEndWithNewline().Trim(); + } + + public const string ExampleNameHeader = "### "; + public const string ExampleCodeHeader = "```powershell"; + public const string ExampleCodeFooter = "```"; + public const string ExampleOutputHeader = "```output"; + public const string ExampleOutputFooter = "```"; + + public static HelpMetadataOutput ToHelpMetadataOutput(this MarkdownHelpInfo helpInfo) => new HelpMetadataOutput(helpInfo); + + public static HelpSyntaxOutput ToHelpSyntaxOutput(this MarkdownSyntaxHelpInfo syntaxInfo, bool hasMultipleParameterSets) => new HelpSyntaxOutput(syntaxInfo, hasMultipleParameterSets); + + public static HelpExampleOutput ToHelpExampleOutput(this MarkdownExampleHelpInfo exampleInfo) => new HelpExampleOutput(exampleInfo); + + public static HelpParameterOutput ToHelpParameterOutput(this MarkdownParameterHelpInfo parameterInfo) => new HelpParameterOutput(parameterInfo); + + public static ModulePageMetadataOutput ToModulePageMetadataOutput(this PsModuleHelpInfo moduleInfo) => new ModulePageMetadataOutput(moduleInfo); + + public static ModulePageCmdletOutput ToModulePageCmdletOutput(this MarkdownHelpInfo helpInfo) => new ModulePageCmdletOutput(helpInfo); + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Models/PsHelpTypes.cs b/swaggerci/storage/generated/runtime/BuildTime/Models/PsHelpTypes.cs new file mode 100644 index 000000000000..ffe878e76cdd --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Models/PsHelpTypes.cs @@ -0,0 +1,202 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal class PsHelpInfo + { + public string CmdletName { get; } + public string ModuleName { get; } + public string Synopsis { get; } + public string Description { get; } + public string AlertText { get; } + public string Category { get; } + public PsHelpLinkInfo OnlineVersion { get; } + public PsHelpLinkInfo[] RelatedLinks { get; } + public bool? HasCommonParameters { get; } + public bool? HasWorkflowCommonParameters { get; } + + public PsHelpTypeInfo[] InputTypes { get; } + public PsHelpTypeInfo[] OutputTypes { get; } + public PsHelpExampleInfo[] Examples { get; set; } + public string[] Aliases { get; } + + public PsParameterHelpInfo[] Parameters { get; } + public PsHelpSyntaxInfo[] Syntax { get; } + + public object Component { get; } + public object Functionality { get; } + public object PsSnapIn { get; } + public object Role { get; } + public string NonTerminatingErrors { get; } + + public PsHelpInfo(PSObject helpObject = null) + { + helpObject = helpObject ?? new PSObject(); + CmdletName = helpObject.GetProperty("Name").NullIfEmpty() ?? helpObject.GetNestedProperty("details", "name"); + ModuleName = helpObject.GetProperty("ModuleName"); + Synopsis = helpObject.GetProperty("Synopsis"); + Description = helpObject.GetProperty("description").EmptyIfNull().ToDescriptionText().NullIfEmpty() ?? + helpObject.GetNestedProperty("details", "description").EmptyIfNull().ToDescriptionText(); + AlertText = helpObject.GetNestedProperty("alertSet", "alert").EmptyIfNull().ToDescriptionText(); + Category = helpObject.GetProperty("Category"); + HasCommonParameters = helpObject.GetProperty("CommonParameters").ToNullableBool(); + HasWorkflowCommonParameters = helpObject.GetProperty("WorkflowCommonParameters").ToNullableBool(); + + var links = helpObject.GetNestedProperty("relatedLinks", "navigationLink").EmptyIfNull().Select(nl => nl.ToLinkInfo()).ToArray(); + OnlineVersion = links.FirstOrDefault(l => l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length == 1); + RelatedLinks = links.Where(l => !l.Text?.ToLowerInvariant().StartsWith("online version:") ?? links.Length != 1).ToArray(); + + InputTypes = helpObject.GetNestedProperty("inputTypes", "inputType").EmptyIfNull().Select(it => it.ToTypeInfo()).ToArray(); + OutputTypes = helpObject.GetNestedProperty("returnValues", "returnValue").EmptyIfNull().Select(rv => rv.ToTypeInfo()).ToArray(); + Examples = helpObject.GetNestedProperty("examples", "example").EmptyIfNull().Select(e => e.ToExampleInfo()).ToArray(); + Aliases = helpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries); + + Parameters = helpObject.GetNestedProperty("parameters", "parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + Syntax = helpObject.GetNestedProperty("syntax", "syntaxItem").EmptyIfNull().Select(si => si.ToSyntaxInfo()).ToArray(); + + Component = helpObject.GetProperty("Component"); + Functionality = helpObject.GetProperty("Functionality"); + PsSnapIn = helpObject.GetProperty("PSSnapIn"); + Role = helpObject.GetProperty("Role"); + NonTerminatingErrors = helpObject.GetProperty("nonTerminatingErrors"); + } + } + + internal class PsHelpTypeInfo + { + public string Name { get; } + public string Description { get; } + + public PsHelpTypeInfo(PSObject typeObject) + { + Name = typeObject.GetNestedProperty("type", "name").EmptyIfNull().Trim(); + Description = typeObject.GetProperty("description").EmptyIfNull().ToDescriptionText(); + } + } + + internal class PsHelpLinkInfo + { + public string Uri { get; } + public string Text { get; } + + public PsHelpLinkInfo(PSObject linkObject) + { + Uri = linkObject.GetProperty("uri"); + Text = linkObject.GetProperty("linkText"); + } + } + + internal class PsHelpSyntaxInfo + { + public string CmdletName { get; } + public PsParameterHelpInfo[] Parameters { get; } + + public PsHelpSyntaxInfo(PSObject syntaxObject) + { + CmdletName = syntaxObject.GetProperty("name"); + Parameters = syntaxObject.GetProperty("parameter").EmptyIfNull().Select(p => p.ToPsParameterHelpInfo()).ToArray(); + } + } + + internal class PsHelpExampleInfo + { + public string Title { get; } + public string Code { get; } + public string Output { get; } + public string Remarks { get; } + + public PsHelpExampleInfo(PSObject exampleObject) + { + Title = exampleObject.GetProperty("title"); + Code = exampleObject.GetProperty("code"); + Output = exampleObject.GetProperty("output"); + Remarks = exampleObject.GetProperty("remarks").EmptyIfNull().ToDescriptionText(); + } + public PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) + { + Title = markdownExample.Name; + Code = markdownExample.Code; + Output = markdownExample.Output; + Remarks = markdownExample.Description; + } + + public static implicit operator PsHelpExampleInfo(MarkdownExampleHelpInfo markdownExample) => new PsHelpExampleInfo(markdownExample); + } + + internal class PsParameterHelpInfo + { + public string DefaultValueAsString { get; } + + public string Name { get; } + public string TypeName { get; } + public string Description { get; } + public string SupportsPipelineInput { get; } + public string PositionText { get; } + public string[] ParameterSetNames { get; } + public string[] Aliases { get; } + + public bool? SupportsGlobbing { get; } + public bool? IsRequired { get; } + public bool? IsVariableLength { get; } + public bool? IsDynamic { get; } + + public PsParameterHelpInfo(PSObject parameterHelpObject = null) + { + parameterHelpObject = parameterHelpObject ?? new PSObject(); + DefaultValueAsString = parameterHelpObject.GetProperty("defaultValue"); + Name = parameterHelpObject.GetProperty("name"); + TypeName = parameterHelpObject.GetProperty("parameterValue").NullIfEmpty() ?? parameterHelpObject.GetNestedProperty("type", "name"); + Description = parameterHelpObject.GetProperty("Description").EmptyIfNull().ToDescriptionText(); + SupportsPipelineInput = parameterHelpObject.GetProperty("pipelineInput"); + PositionText = parameterHelpObject.GetProperty("position"); + ParameterSetNames = parameterHelpObject.GetProperty("parameterSetName").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + Aliases = parameterHelpObject.GetProperty("aliases").EmptyIfNull().Split(new[] { ", " }, StringSplitOptions.RemoveEmptyEntries); + + SupportsGlobbing = parameterHelpObject.GetProperty("globbing").ToNullableBool(); + IsRequired = parameterHelpObject.GetProperty("required").ToNullableBool(); + IsVariableLength = parameterHelpObject.GetProperty("variableLength").ToNullableBool(); + IsDynamic = parameterHelpObject.GetProperty("isDynamic").ToNullableBool(); + } + } + + internal class PsModuleHelpInfo + { + public string Name { get; } + public Guid Guid { get; } + public string Description { get; } + + public PsModuleHelpInfo(PSModuleInfo moduleInfo) + : this(moduleInfo?.Name ?? String.Empty, moduleInfo?.Guid ?? Guid.NewGuid(), moduleInfo?.Description ?? String.Empty) + { + } + + public PsModuleHelpInfo(string name, Guid guid, string description) + { + Name = name; + Guid = guid; + Description = description; + } + } + + internal static class HelpTypesExtensions + { + public static PsHelpInfo ToPsHelpInfo(this PSObject helpObject) => new PsHelpInfo(helpObject); + public static PsParameterHelpInfo ToPsParameterHelpInfo(this PSObject parameterHelpObject) => new PsParameterHelpInfo(parameterHelpObject); + + public static string ToDescriptionText(this IEnumerable descriptionObject) => descriptionObject != null + ? String.Join(Environment.NewLine, descriptionObject.Select(dl => dl.GetProperty("Text").EmptyIfNull())).NullIfWhiteSpace() + : null; + public static PsHelpTypeInfo ToTypeInfo(this PSObject typeObject) => new PsHelpTypeInfo(typeObject); + public static PsHelpExampleInfo ToExampleInfo(this PSObject exampleObject) => new PsHelpExampleInfo(exampleObject); + public static PsHelpLinkInfo ToLinkInfo(this PSObject linkObject) => new PsHelpLinkInfo(linkObject); + public static PsHelpSyntaxInfo ToSyntaxInfo(this PSObject syntaxObject) => new PsHelpSyntaxInfo(syntaxObject); + public static PsModuleHelpInfo ToModuleInfo(this PSModuleInfo moduleInfo) => new PsModuleHelpInfo(moduleInfo); + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs b/swaggerci/storage/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs new file mode 100644 index 000000000000..1ed65e213160 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Models/PsMarkdownTypes.cs @@ -0,0 +1,294 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.MarkdownTypesExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsHelpOutputExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal class MarkdownHelpInfo + { + public string ExternalHelpFilename { get; } + public string ModuleName { get; } + public string OnlineVersion { get; } + public Version Schema { get; } + + public string CmdletName { get; } + public string[] Aliases { get; } + public string Synopsis { get; } + public string Description { get; } + + public MarkdownSyntaxHelpInfo[] SyntaxInfos { get; } + public MarkdownExampleHelpInfo[] Examples { get; } + public MarkdownParameterHelpInfo[] Parameters { get; } + + public string[] Inputs { get; } + public string[] Outputs { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + public string[] RelatedLinks { get; } + + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public MarkdownHelpInfo(VariantGroup variantGroup, string examplesFolder, string externalHelpFilename = "") + { + ExternalHelpFilename = externalHelpFilename; + ModuleName = variantGroup.RootModuleName != "" ? variantGroup.RootModuleName : variantGroup.ModuleName; + var helpInfo = variantGroup.HelpInfo; + var commentInfo = variantGroup.CommentInfo; + Schema = Version.Parse("2.0.0"); + + CmdletName = variantGroup.CmdletName; + Aliases = (variantGroup.Aliases.NullIfEmpty() ?? helpInfo.Aliases).Where(a => a != "None").ToArray(); + Synopsis = commentInfo.Synopsis; + Description = commentInfo.Description; + + SyntaxInfos = variantGroup.Variants + .Select(v => new MarkdownSyntaxHelpInfo(v, variantGroup.ParameterGroups, v.VariantName == variantGroup.DefaultParameterSetName)) + .OrderByDescending(v => v.IsDefault).ThenBy(v => v.ParameterSetName).ToArray(); + Examples = GetExamplesFromMarkdown(examplesFolder).NullIfEmpty() + ?? helpInfo.Examples.Select(e => e.ToExampleHelpInfo()).ToArray().NullIfEmpty() + ?? DefaultExampleHelpInfos; + + Parameters = variantGroup.ParameterGroups + .Where(pg => !pg.DontShow && !pg.Parameters.All(p => p.IsHidden())) + .Select(pg => new MarkdownParameterHelpInfo( + variantGroup.Variants.SelectMany(v => v.HelpInfo.Parameters).Where(phi => phi.Name == pg.ParameterName).ToArray(), pg)) + .OrderBy(phi => phi.Name).ToArray(); + + Inputs = commentInfo.Inputs; + Outputs = commentInfo.Outputs; + + ComplexInterfaceInfos = variantGroup.ComplexInterfaceInfos; + OnlineVersion = commentInfo.OnlineVersion; + RelatedLinks = commentInfo.RelatedLinks; + + SupportsShouldProcess = variantGroup.SupportsShouldProcess; + SupportsPaging = variantGroup.SupportsPaging; + } + + private MarkdownExampleHelpInfo[] GetExamplesFromMarkdown(string examplesFolder) + { + var filePath = Path.Combine(examplesFolder, $"{CmdletName}.md"); + if (!Directory.Exists(examplesFolder) || !File.Exists(filePath)) return null; + + var lines = File.ReadAllLines(filePath); + var nameIndices = lines.Select((l, i) => l.StartsWith(ExampleNameHeader) ? i : -1).Where(i => i != -1).ToArray(); + //https://codereview.stackexchange.com/a/187148/68772 + var indexCountGroups = nameIndices.Skip(1).Append(lines.Length).Zip(nameIndices, (next, current) => (NameIndex: current, LineCount: next - current)); + var exampleGroups = indexCountGroups.Select(icg => lines.Skip(icg.NameIndex).Take(icg.LineCount).ToArray()); + return exampleGroups.Select(eg => + { + var name = eg.First().Replace(ExampleNameHeader, String.Empty); + var codeStartIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var codeEndIndex = eg.Select((l, i) => l.StartsWith(ExampleCodeFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i != codeStartIndex); + var code = codeStartIndex.HasValue && codeEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(codeStartIndex.Value + 1).Take(codeEndIndex.Value - (codeStartIndex.Value + 1))) + : String.Empty; + var outputStartIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputHeader) ? (int?)i : null).FirstOrDefault(i => i.HasValue); + var outputEndIndex = eg.Select((l, i) => l.StartsWith(ExampleOutputFooter) ? (int?)i : null).FirstOrDefault(i => i.HasValue && i > outputStartIndex); + var output = outputStartIndex.HasValue && outputEndIndex.HasValue + ? String.Join(Environment.NewLine, eg.Skip(outputStartIndex.Value + 1).Take(outputEndIndex.Value - (outputStartIndex.Value + 1))) + : String.Empty; + var descriptionStartIndex = (outputEndIndex ?? (codeEndIndex ?? 0)) + 1; + descriptionStartIndex = String.IsNullOrWhiteSpace(eg[descriptionStartIndex]) ? descriptionStartIndex + 1 : descriptionStartIndex; + var descriptionEndIndex = eg.Length - 1; + descriptionEndIndex = String.IsNullOrWhiteSpace(eg[descriptionEndIndex]) ? descriptionEndIndex - 1 : descriptionEndIndex; + var description = String.Join(Environment.NewLine, eg.Skip(descriptionStartIndex).Take((descriptionEndIndex + 1) - descriptionStartIndex)); + return new MarkdownExampleHelpInfo(name, code, output, description); + }).ToArray(); + } + } + + internal class MarkdownSyntaxHelpInfo + { + public Variant Variant { get; } + public bool IsDefault { get; } + public string ParameterSetName { get; } + public Parameter[] Parameters { get; } + public string SyntaxText { get; } + + public MarkdownSyntaxHelpInfo(Variant variant, ParameterGroup[] parameterGroups, bool isDefault) + { + Variant = variant; + IsDefault = isDefault; + ParameterSetName = Variant.VariantName; + Parameters = Variant.Parameters + .Where(p => !p.DontShow && !p.IsHidden()).OrderByDescending(p => p.IsMandatory) + //https://stackoverflow.com/a/6461526/294804 + .ThenByDescending(p => p.Position.HasValue).ThenBy(p => p.Position) + // Use the OrderCategory of the parameter group because the final order category is the highest of the group, and not the order category of the individual parameters from the variants. + .ThenBy(p => parameterGroups.First(pg => pg.ParameterName == p.ParameterName).OrderCategory).ThenBy(p => p.ParameterName).ToArray(); + SyntaxText = CreateSyntaxFormat(); + } + + //https://github.com/PowerShell/platyPS/blob/a607a926bfffe1e1a1e53c19e0057eddd0c07611/src/Markdown.MAML/Renderer/Markdownv2Renderer.cs#L29-L32 + private const int SyntaxLineWidth = 110; + private string CreateSyntaxFormat() + { + var parameterStrings = Parameters.Select(p => p.ToPropertySyntaxOutput().ToString()); + if (Variant.SupportsShouldProcess) + { + parameterStrings = parameterStrings.Append(" [-Confirm]").Append(" [-WhatIf]"); + } + parameterStrings = parameterStrings.Append(" []"); + + var lines = new List(20); + return parameterStrings.Aggregate(Variant.CmdletName, (current, ps) => + { + var combined = current + ps; + if (combined.Length <= SyntaxLineWidth) return combined; + + lines.Add(current); + return ps; + }, last => + { + lines.Add(last); + return String.Join(Environment.NewLine, lines); + }); + } + } + + internal class MarkdownExampleHelpInfo + { + public string Name { get; } + public string Code { get; } + public string Output { get; } + public string Description { get; } + + public MarkdownExampleHelpInfo(string name, string code, string output, string description) + { + Name = name; + Code = code; + Output = output; + Description = description; + } + } + + internal class MarkdownParameterHelpInfo + { + public string Name { get; set; } + public string Description { get; set; } + public Type Type { get; set; } + public string Position { get; set; } + public string DefaultValue { get; set; } + + public bool HasAllParameterSets { get; set; } + public string[] ParameterSetNames { get; set; } + public string[] Aliases { get; set; } + + public bool IsRequired { get; set; } + public bool IsDynamic { get; set; } + public bool AcceptsPipelineByValue { get; set; } + public bool AcceptsPipelineByPropertyName { get; set; } + public bool AcceptsWildcardCharacters { get; set; } + + // For use by common parameters that have no backing data in the objects themselves. + public MarkdownParameterHelpInfo() { } + + public MarkdownParameterHelpInfo(PsParameterHelpInfo[] parameterHelpInfos, ParameterGroup parameterGroup) + { + Name = parameterGroup.ParameterName; + Description = parameterGroup.Description.NullIfEmpty() + ?? parameterHelpInfos.Select(phi => phi.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + Type = parameterGroup.ParameterType; + Position = parameterGroup.FirstPosition?.ToString() + ?? parameterHelpInfos.Select(phi => phi.PositionText).FirstOrDefault(d => !String.IsNullOrEmpty(d)).ToUpperFirstCharacter().NullIfEmpty() + ?? "Named"; + // This no longer uses firstHelpInfo.DefaultValueAsString since it seems to be broken. For example, it has a value of 0 for Int32, but no default value was declared. + DefaultValue = parameterGroup.DefaultInfo?.Script ?? "None"; + + HasAllParameterSets = parameterGroup.HasAllVariants; + ParameterSetNames = (parameterGroup.Parameters.Select(p => p.VariantName).ToArray().NullIfEmpty() + ?? parameterHelpInfos.SelectMany(phi => phi.ParameterSetNames).Distinct()) + .OrderBy(psn => psn).ToArray(); + Aliases = parameterGroup.Aliases.NullIfEmpty() ?? parameterHelpInfos.SelectMany(phi => phi.Aliases).ToArray(); + + IsRequired = parameterHelpInfos.Select(phi => phi.IsRequired).FirstOrDefault(r => r == true) ?? parameterGroup.Parameters.Any(p => p.IsMandatory); + IsDynamic = parameterHelpInfos.Select(phi => phi.IsDynamic).FirstOrDefault(d => d == true) ?? false; + AcceptsPipelineByValue = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByValue")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipeline; + AcceptsPipelineByPropertyName = parameterHelpInfos.Select(phi => phi.SupportsPipelineInput?.Contains("ByPropertyName")).FirstOrDefault(bv => bv == true) ?? parameterGroup.ValueFromPipelineByPropertyName; + AcceptsWildcardCharacters = parameterGroup.SupportsWildcards; + } + } + + internal static class MarkdownTypesExtensions + { + public static MarkdownExampleHelpInfo ToExampleHelpInfo(this PsHelpExampleInfo exampleInfo) => new MarkdownExampleHelpInfo(exampleInfo.Title, exampleInfo.Code, exampleInfo.Output, exampleInfo.Remarks); + + public static MarkdownExampleHelpInfo[] DefaultExampleHelpInfos = + { + new MarkdownExampleHelpInfo("Example 1: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + new MarkdownExampleHelpInfo("Example 2: {{ Add title here }}", $@"{{{{ Add code here }}}}", $@"{{{{ Add output here }}}}", @"{{ Add description here }}"), + }; + + public static MarkdownParameterHelpInfo[] SupportsShouldProcessParameters = + { + new MarkdownParameterHelpInfo + { + Name = "Confirm", + Description ="Prompts you for confirmation before running the cmdlet.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "cf" } + }, + new MarkdownParameterHelpInfo + { + Name = "WhatIf", + Description ="Shows what would happen if the cmdlet runs. The cmdlet is not run.", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new [] { "wi" } + } + }; + + public static MarkdownParameterHelpInfo[] SupportsPagingParameters = + { + new MarkdownParameterHelpInfo + { + Name = "First", + Description ="Gets only the first 'n' objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "IncludeTotalCount", + Description ="Reports the number of objects in the data set (an integer) followed by the objects. If the cmdlet cannot determine the total count, it returns \"Unknown total count\".", + Type = typeof(SwitchParameter), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + }, + new MarkdownParameterHelpInfo + { + Name = "Skip", + Description ="Ignores the first 'n' objects and then gets the remaining objects.", + Type = typeof(ulong), + Position = "Named", + DefaultValue = "None", + HasAllParameterSets = true, + ParameterSetNames = new [] { "(All)" }, + Aliases = new string[0] + } + }; + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Models/PsProxyOutputs.cs b/swaggerci/storage/generated/runtime/BuildTime/Models/PsProxyOutputs.cs new file mode 100644 index 000000000000..eefcc8ef38f1 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Models/PsProxyOutputs.cs @@ -0,0 +1,611 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Text; +using System.Text.RegularExpressions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal class OutputTypeOutput + { + public PSTypeName[] OutputTypes { get; } + + public OutputTypeOutput(IEnumerable outputTypes) + { + OutputTypes = outputTypes.ToArray(); + } + + public override string ToString() => OutputTypes != null && OutputTypes.Any() ? $"[OutputType({OutputTypes.Select(ot => $"[{ot}]").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class CmdletBindingOutput + { + public VariantGroup VariantGroup { get; } + + public CmdletBindingOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + + public override string ToString() + { + var dpsText = VariantGroup.DefaultParameterSetName.IsValidDefaultParameterSetName() ? $"DefaultParameterSetName='{VariantGroup.DefaultParameterSetName}'" : String.Empty; + var sspText = VariantGroup.SupportsShouldProcess ? $"SupportsShouldProcess{ItemSeparator}ConfirmImpact='Medium'" : String.Empty; + var pbText = $"PositionalBinding={false.ToPsBool()}"; + var propertyText = new[] { dpsText, pbText, sspText }.JoinIgnoreEmpty(ItemSeparator); + return $"[CmdletBinding({propertyText})]{Environment.NewLine}"; + } + } + + internal class ParameterOutput + { + public Parameter Parameter { get; } + public bool HasMultipleVariantsInVariantGroup { get; } + public bool HasAllVariantsInParameterGroup { get; } + + public ParameterOutput(Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) + { + Parameter = parameter; + HasMultipleVariantsInVariantGroup = hasMultipleVariantsInVariantGroup; + HasAllVariantsInParameterGroup = hasAllVariantsInParameterGroup; + } + + public override string ToString() + { + var psnText = HasMultipleVariantsInVariantGroup && !HasAllVariantsInParameterGroup ? $"ParameterSetName='{Parameter.VariantName}'" : String.Empty; + var positionText = Parameter.Position != null ? $"Position={Parameter.Position}" : String.Empty; + var mandatoryText = Parameter.IsMandatory ? "Mandatory" : String.Empty; + var dontShowText = Parameter.DontShow ? "DontShow" : String.Empty; + var vfpText = Parameter.ValueFromPipeline ? "ValueFromPipeline" : String.Empty; + var vfpbpnText = Parameter.ValueFromPipelineByPropertyName ? "ValueFromPipelineByPropertyName" : String.Empty; + var propertyText = new[] { psnText, positionText, mandatoryText, dontShowText, vfpText, vfpbpnText }.JoinIgnoreEmpty(ItemSeparator); + return $"{Indent}[Parameter({propertyText})]{Environment.NewLine}"; + } + } + + internal class AliasOutput + { + public string[] Aliases { get; } + public bool IncludeIndent { get; } + + public AliasOutput(string[] aliases, bool includeIndent = false) + { + Aliases = aliases; + IncludeIndent = includeIndent; + } + + public override string ToString() => Aliases?.Any() ?? false ? $"{(IncludeIndent ? Indent : String.Empty)}[Alias({Aliases.Select(an => $"'{an}'").JoinIgnoreEmpty(ItemSeparator)})]{Environment.NewLine}" : String.Empty; + } + + internal class ValidateNotNullOutput + { + public bool HasValidateNotNull { get; } + + public ValidateNotNullOutput(bool hasValidateNotNull) + { + HasValidateNotNull = hasValidateNotNull; + } + + public override string ToString() => HasValidateNotNull ? $"{Indent}[ValidateNotNull()]{Environment.NewLine}" : String.Empty; + } + + internal class AllowEmptyArrayOutput + { + public bool HasAllowEmptyArray { get; } + + public AllowEmptyArrayOutput(bool hasAllowEmptyArray) + { + HasAllowEmptyArray = hasAllowEmptyArray; + } + + public override string ToString() => HasAllowEmptyArray ? $"{Indent}[AllowEmptyCollection()]{Environment.NewLine}" : String.Empty; + } + internal class ArgumentCompleterOutput + { + public CompleterInfo CompleterInfo { get; } + + public ArgumentCompleterOutput(CompleterInfo completerInfo) + { + CompleterInfo = completerInfo; + } + + public override string ToString() => CompleterInfo != null + ? $"{Indent}[ArgumentCompleter({(CompleterInfo.IsTypeCompleter ? $"[{CompleterInfo.Type.Unwrap().ToPsType()}]" : $"{{{CompleterInfo.Script.ToPsSingleLine("; ")}}}")})]{Environment.NewLine}" + : String.Empty; + } + + internal class DefaultInfoOutput + { + public bool HasDefaultInfo { get; } + public DefaultInfo DefaultInfo { get; } + + public DefaultInfoOutput(ParameterGroup parameterGroup) + { + HasDefaultInfo = parameterGroup.HasDefaultInfo; + DefaultInfo = parameterGroup.DefaultInfo; + } + + public override string ToString() + { + var nameText = !String.IsNullOrEmpty(DefaultInfo?.Name) ? $"Name='{DefaultInfo?.Name}'" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(DefaultInfo?.Description) ? $"Description='{DefaultInfo?.Description.ToPsStringLiteral()}'" : String.Empty; + var scriptText = !String.IsNullOrEmpty(DefaultInfo?.Script) ? $"Script='{DefaultInfo?.Script.ToPsSingleLine("; ")}'" : String.Empty; + var propertyText = new[] { nameText, descriptionText, scriptText }.JoinIgnoreEmpty(ItemSeparator); + return HasDefaultInfo ? $"{Indent}[{typeof(DefaultInfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class ParameterTypeOutput + { + public Type ParameterType { get; } + + public ParameterTypeOutput(Type parameterType) + { + ParameterType = parameterType; + } + + public override string ToString() => $"{Indent}[{ParameterType.ToPsType()}]{Environment.NewLine}"; + } + + internal class ParameterNameOutput + { + public string ParameterName { get; } + public bool IsLast { get; } + + public ParameterNameOutput(string parameterName, bool isLast) + { + ParameterName = parameterName; + IsLast = isLast; + } + + public override string ToString() => $"{Indent}${{{ParameterName}}}{(IsLast ? String.Empty : $",{Environment.NewLine}")}{Environment.NewLine}"; + } + + internal class BaseOutput + { + public VariantGroup VariantGroup { get; } + + protected static readonly bool IsAzure = Convert.ToBoolean(@"true"); + public BaseOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + } + public string ClearTelemetryContext() + { + return (!VariantGroup.IsInternal && IsAzure) ? $@"{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext()" : ""; + } + } + + internal class BeginOutput : BaseOutput + { + public BeginOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + public string GetProcessCustomAttributesAtRuntime() + { + return VariantGroup.IsInternal ? "" : $@"{Indent}{Indent}$cmdInfo = Get-Command -Name $mapping[$parameterSet]{Environment.NewLine}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.MessageAttributeHelper]::ProcessCustomAttributesAtRuntime($cmdInfo, $MyInvocation, $parameterSet, $PSCmdlet)"; + } + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}if ($null -eq [Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion) {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Utilities.Common.AzurePSCmdlet]::PowerShellVersion = $Host.Version.ToString() +{Indent}{Indent}}} +{Indent}{Indent}$preTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId =(New-Guid).ToString() +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Create', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}$internalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}{Indent}if ($internalCalledCmdlets -eq '') {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} else {{ +{Indent}{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets += ',' + $MyInvocation.MyCommand.Name +{Indent}{Indent}{Indent}}} +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = 'internal' +{Indent}{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"begin {{ +{Indent}try {{ +{Indent}{Indent}$outBuffer = $null +{Indent}{Indent}if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) {{ +{Indent}{Indent}{Indent}$PSBoundParameters['OutBuffer'] = 1 +{Indent}{Indent}}} +{Indent}{Indent}$parameterSet = $PSCmdlet.ParameterSetName +{GetTelemetry()} +{GetParameterSetToCmdletMapping()}{GetDefaultValuesStatements()} +{GetProcessCustomAttributesAtRuntime()} +{Indent}{Indent}$wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) +{Indent}{Indent}$scriptCmd = {{& $wrappedCmd @PSBoundParameters}} +{Indent}{Indent}$steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) +{Indent}{Indent}$steppablePipeline.Begin($PSCmdlet) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} + +"; + + private string GetParameterSetToCmdletMapping() + { + var sb = new StringBuilder(); + sb.AppendLine($"{Indent}{Indent}$mapping = @{{"); + foreach (var variant in VariantGroup.Variants) + { + sb.AppendLine($@"{Indent}{Indent}{Indent}{variant.VariantName} = '{variant.PrivateModuleName}\{variant.PrivateCmdletName}';"); + } + sb.Append($"{Indent}{Indent}}}"); + return sb.ToString(); + } + + private string GetDefaultValuesStatements() + { + var defaultInfos = VariantGroup.ParameterGroups.Where(pg => pg.HasDefaultInfo).Select(pg => pg.DefaultInfo).ToArray(); + var sb = new StringBuilder(); + + foreach (var defaultInfo in defaultInfos) + { + var variantListString = defaultInfo.ParameterGroup.VariantNames.ToPsList(); + var parameterName = defaultInfo.ParameterGroup.ParameterName; + sb.AppendLine(); + sb.AppendLine($"{Indent}{Indent}if (({variantListString}) -contains $parameterSet -and -not $PSBoundParameters.ContainsKey('{parameterName}')) {{"); + sb.AppendLine($"{Indent}{Indent}{Indent}$PSBoundParameters['{parameterName}'] = {defaultInfo.Script}"); + sb.Append($"{Indent}{Indent}}}"); + } + return sb.ToString(); + } + } + + internal class ProcessOutput : BaseOutput + { + public ProcessOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetFinally() + { + if (IsAzure && !VariantGroup.IsInternal) + { + return $@" +{Indent}finally {{ +{Indent}{Indent}$backupTelemetryId = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId +{Indent}{Indent}$backupInternalCalledCmdlets = [Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}}} +"; + } + return ""; + } + public override string ToString() => $@"process {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.Process($_) +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +{GetFinally()} +}} +"; + } + + internal class EndOutput : BaseOutput + { + public EndOutput(VariantGroup variantGroup) : base(variantGroup) + { + } + + private string GetTelemetry() + { + if (!VariantGroup.IsInternal && IsAzure) + { + return $@" +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $backupTelemetryId +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::InternalCalledCmdlets = $backupInternalCalledCmdlets +{Indent}{Indent}if ($preTelemetryId -eq '') {{ +{Indent}{Indent}{Indent}[Microsoft.Azure.PowerShell.Cmdlets.Storage.module]::Instance.Telemetry.Invoke('Send', $MyInvocation, $parameterSet, $PSCmdlet) +{Indent}{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::ClearTelemetryContext() +{Indent}{Indent}}} +{Indent}{Indent}[Microsoft.WindowsAzure.Commands.Common.MetricHelper]::TelemetryId = $preTelemetryId +"; + } + return ""; + } + public override string ToString() => $@"end {{ +{Indent}try {{ +{Indent}{Indent}$steppablePipeline.End() +{GetTelemetry()} +{Indent}}} catch {{ +{ClearTelemetryContext()} +{Indent}{Indent}throw +{Indent}}} +}} +"; + } + + internal class HelpCommentOutput + { + public VariantGroup VariantGroup { get; } + public CommentInfo CommentInfo { get; } + + public HelpCommentOutput(VariantGroup variantGroup) + { + VariantGroup = variantGroup; + CommentInfo = variantGroup.CommentInfo; + } + + public override string ToString() + { + var inputs = String.Join(Environment.NewLine, CommentInfo.Inputs.Select(i => $".Inputs{Environment.NewLine}{i}")); + var inputsText = !String.IsNullOrEmpty(inputs) ? $"{Environment.NewLine}{inputs}" : String.Empty; + var outputs = String.Join(Environment.NewLine, CommentInfo.Outputs.Select(o => $".Outputs{Environment.NewLine}{o}")); + var outputsText = !String.IsNullOrEmpty(outputs) ? $"{Environment.NewLine}{outputs}" : String.Empty; + var notes = String.Join($"{Environment.NewLine}{Environment.NewLine}", VariantGroup.ComplexInterfaceInfos.Select(cii => cii.ToNoteOutput())); + var notesText = !String.IsNullOrEmpty(notes) ? $"{Environment.NewLine}.Notes{Environment.NewLine}{ComplexParameterHeader}{notes}" : String.Empty; + var relatedLinks = String.Join(Environment.NewLine, CommentInfo.RelatedLinks.Select(l => $".Link{Environment.NewLine}{l}")); + var relatedLinksText = !String.IsNullOrEmpty(relatedLinks) ? $"{Environment.NewLine}{relatedLinks}" : String.Empty; + var examples = ""; + foreach (var example in VariantGroup.HelpInfo.Examples) + { + examples = examples + ".Example" + "\r\n" + example.Code + "\r\n"; + } + return $@"<# +.Synopsis +{CommentInfo.Synopsis.ToDescriptionFormat(false)} +.Description +{CommentInfo.Description.ToDescriptionFormat(false)} +{examples}{inputsText}{outputsText}{notesText} +.Link +{CommentInfo.OnlineVersion}{relatedLinksText} +#> +"; + } + } + + internal class ParameterDescriptionOutput + { + public string Description { get; } + + public ParameterDescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) + ? Description.ToDescriptionFormat(false).NormalizeNewLines() + .Split(new[] { Environment.NewLine }, StringSplitOptions.None) + .Aggregate(String.Empty, (c, n) => c + $"{Indent}# {n}{Environment.NewLine}") + : String.Empty; + } + + internal class ProfileOutput + { + public string ProfileName { get; } + + public ProfileOutput(string profileName) + { + ProfileName = profileName; + } + + public override string ToString() => ProfileName != NoProfiles ? $"[{typeof(ProfileAttribute).ToPsAttributeType()}('{ProfileName}')]{Environment.NewLine}" : String.Empty; + } + + internal class DescriptionOutput + { + public string Description { get; } + + public DescriptionOutput(string description) + { + Description = description; + } + + public override string ToString() => !String.IsNullOrEmpty(Description) ? $"[{typeof(DescriptionAttribute).ToPsAttributeType()}('{Description.ToPsStringLiteral()}')]{Environment.NewLine}" : String.Empty; + } + + internal class ParameterCategoryOutput + { + public ParameterCategory Category { get; } + + public ParameterCategoryOutput(ParameterCategory category) + { + Category = category; + } + + public override string ToString() => $"{Indent}[{typeof(CategoryAttribute).ToPsAttributeType()}('{Category}')]{Environment.NewLine}"; + } + + internal class InfoOutput + { + public InfoAttribute Info { get; } + public Type ParameterType { get; } + + public InfoOutput(InfoAttribute info, Type parameterType) + { + Info = info; + ParameterType = parameterType; + } + + public override string ToString() + { + // Rendering of InfoAttribute members that are not used currently + /*var serializedNameText = Info.SerializedName != null ? $"SerializedName='{Info.SerializedName}'" : String.Empty; + var readOnlyText = Info.ReadOnly ? "ReadOnly" : String.Empty; + var descriptionText = !String.IsNullOrEmpty(Info.Description) ? $"Description='{Info.Description.ToPsStringLiteral()}'" : String.Empty;*/ + + var requiredText = Info.Required ? "Required" : String.Empty; + var unwrappedType = ParameterType.Unwrap(); + var hasValidPossibleTypes = Info.PossibleTypes.Any(pt => pt != unwrappedType); + var possibleTypesText = hasValidPossibleTypes + ? $"PossibleTypes=({Info.PossibleTypes.Select(pt => $"[{pt.ToPsType()}]").JoinIgnoreEmpty(ItemSeparator)})" + : String.Empty; + var propertyText = new[] { /*serializedNameText, */requiredText,/* readOnlyText,*/ possibleTypesText/*, descriptionText*/ }.JoinIgnoreEmpty(ItemSeparator); + return hasValidPossibleTypes ? $"{Indent}[{typeof(InfoAttribute).ToPsAttributeType()}({propertyText})]{Environment.NewLine}" : String.Empty; + } + } + + internal class PropertySyntaxOutput + { + public string ParameterName { get; } + public Type ParameterType { get; } + public bool IsMandatory { get; } + public int? Position { get; } + + public bool IncludeSpace { get; } + public bool IncludeDash { get; } + + public PropertySyntaxOutput(Parameter parameter) + { + ParameterName = parameter.ParameterName; + ParameterType = parameter.ParameterType; + IsMandatory = parameter.IsMandatory; + Position = parameter.Position; + IncludeSpace = true; + IncludeDash = true; + } + + public PropertySyntaxOutput(ComplexInterfaceInfo complexInterfaceInfo) + { + ParameterName = complexInterfaceInfo.Name; + ParameterType = complexInterfaceInfo.Type; + IsMandatory = complexInterfaceInfo.Required; + Position = null; + IncludeSpace = false; + IncludeDash = false; + } + + public override string ToString() + { + var leftOptional = !IsMandatory ? "[" : String.Empty; + var leftPositional = Position != null ? "[" : String.Empty; + var rightPositional = Position != null ? "]" : String.Empty; + var type = ParameterType != typeof(SwitchParameter) ? $" <{ParameterType.ToSyntaxTypeName()}>" : String.Empty; + var rightOptional = !IsMandatory ? "]" : String.Empty; + var space = IncludeSpace ? " " : String.Empty; + var dash = IncludeDash ? "-" : String.Empty; + return $"{space}{leftOptional}{leftPositional}{dash}{ParameterName}{rightPositional}{type}{rightOptional}"; + } + } + + internal static class PsProxyOutputExtensions + { + public const string NoParameters = "__NoParameters"; + + public const string AllParameterSets = "__AllParameterSets"; + + public const string HalfIndent = " "; + + public const string Indent = HalfIndent + HalfIndent; + + public const string ItemSeparator = ", "; + + public static readonly string ComplexParameterHeader = $"COMPLEX PARAMETER PROPERTIES{Environment.NewLine}{Environment.NewLine}To create the parameters described below, construct a hash table containing the appropriate properties. For information on hash tables, run Get-Help about_Hash_Tables.{Environment.NewLine}{Environment.NewLine}"; + + public static string ToPsBool(this bool value) => $"${value.ToString().ToLowerInvariant()}"; + + public static string ToPsType(this Type type) + { + var regex = new Regex(@"^(.*)`{1}\d+(.*)$"); + var typeText = type.ToString(); + var match = regex.Match(typeText); + return match.Success ? $"{match.Groups[1]}{match.Groups[2]}" : typeText; + } + + public static string ToPsAttributeType(this Type type) => type.ToPsType().RemoveEnd("Attribute"); + + // https://stackoverflow.com/a/5284606/294804 + private static string RemoveEnd(this string text, string suffix) => text.EndsWith(suffix) ? text.Substring(0, text.Length - suffix.Length) : text; + + public static string ToPsSingleLine(this string value, string replacer = " ") => value.ReplaceNewLines(replacer, new[] { "
", "\r\n", "\n" }); + + public static string ToPsStringLiteral(this string value) => value?.Replace("'", "''").Replace("‘", "''").Replace("’", "''").ToPsSingleLine().Trim() ?? String.Empty; + + public static string JoinIgnoreEmpty(this IEnumerable values, string separator) => String.Join(separator, values?.Where(v => !String.IsNullOrEmpty(v))); + + // https://stackoverflow.com/a/41961738/294804 + public static string ToSyntaxTypeName(this Type type) + { + if (type.IsGenericType && type.GetGenericTypeDefinition() == typeof(Nullable<>)) + { + return $"{type.GetGenericArguments().First().ToSyntaxTypeName()}?"; + } + + if (type.IsGenericType) + { + var genericTypes = String.Join(ItemSeparator, type.GetGenericArguments().Select(ToSyntaxTypeName)); + return $"{type.Name.Split('`').First()}<{genericTypes}>"; + } + + return type.Name; + } + + public static OutputTypeOutput ToOutputTypeOutput(this IEnumerable outputTypes) => new OutputTypeOutput(outputTypes); + + public static CmdletBindingOutput ToCmdletBindingOutput(this VariantGroup variantGroup) => new CmdletBindingOutput(variantGroup); + + public static ParameterOutput ToParameterOutput(this Parameter parameter, bool hasMultipleVariantsInVariantGroup, bool hasAllVariantsInParameterGroup) => new ParameterOutput(parameter, hasMultipleVariantsInVariantGroup, hasAllVariantsInParameterGroup); + + public static AliasOutput ToAliasOutput(this string[] aliases, bool includeIndent = false) => new AliasOutput(aliases, includeIndent); + + public static ValidateNotNullOutput ToValidateNotNullOutput(this bool hasValidateNotNull) => new ValidateNotNullOutput(hasValidateNotNull); + + public static AllowEmptyArrayOutput ToAllowEmptyArray(this bool hasAllowEmptyArray) => new AllowEmptyArrayOutput(hasAllowEmptyArray); + + public static ArgumentCompleterOutput ToArgumentCompleterOutput(this CompleterInfo completerInfo) => new ArgumentCompleterOutput(completerInfo); + + public static DefaultInfoOutput ToDefaultInfoOutput(this ParameterGroup parameterGroup) => new DefaultInfoOutput(parameterGroup); + + public static ParameterTypeOutput ToParameterTypeOutput(this Type parameterType) => new ParameterTypeOutput(parameterType); + + public static ParameterNameOutput ToParameterNameOutput(this string parameterName, bool isLast) => new ParameterNameOutput(parameterName, isLast); + + public static BeginOutput ToBeginOutput(this VariantGroup variantGroup) => new BeginOutput(variantGroup); + + public static ProcessOutput ToProcessOutput(this VariantGroup variantGroup) => new ProcessOutput(variantGroup); + + public static EndOutput ToEndOutput(this VariantGroup variantGroup) => new EndOutput(variantGroup); + + public static HelpCommentOutput ToHelpCommentOutput(this VariantGroup variantGroup) => new HelpCommentOutput(variantGroup); + + public static ParameterDescriptionOutput ToParameterDescriptionOutput(this string description) => new ParameterDescriptionOutput(description); + + public static ProfileOutput ToProfileOutput(this string profileName) => new ProfileOutput(profileName); + + public static DescriptionOutput ToDescriptionOutput(this string description) => new DescriptionOutput(description); + + public static ParameterCategoryOutput ToParameterCategoryOutput(this ParameterCategory category) => new ParameterCategoryOutput(category); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this Parameter parameter) => new PropertySyntaxOutput(parameter); + + public static PropertySyntaxOutput ToPropertySyntaxOutput(this ComplexInterfaceInfo complexInterfaceInfo) => new PropertySyntaxOutput(complexInterfaceInfo); + + public static InfoOutput ToInfoOutput(this InfoAttribute info, Type parameterType) => new InfoOutput(info, parameterType); + + public static string ToNoteOutput(this ComplexInterfaceInfo complexInterfaceInfo, string currentIndent = "", bool includeDashes = false, bool includeBackticks = false, bool isFirst = true) + { + string RenderProperty(ComplexInterfaceInfo info, string indent, bool dash, bool backtick) => + $"{indent}{(dash ? "- " : String.Empty)}{(backtick ? "`" : String.Empty)}{info.ToPropertySyntaxOutput()}{(backtick ? "`" : String.Empty)}: {info.Description}"; + + var nested = complexInterfaceInfo.NestedInfos.Select(ni => + { + var nestedIndent = $"{currentIndent}{HalfIndent}"; + return ni.IsComplexInterface + ? ni.ToNoteOutput(nestedIndent, includeDashes, includeBackticks, false) + : RenderProperty(ni, nestedIndent, includeDashes, includeBackticks); + }).Prepend(RenderProperty(complexInterfaceInfo, currentIndent, !isFirst && includeDashes, includeBackticks)); + return String.Join(Environment.NewLine, nested); + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/Models/PsProxyTypes.cs b/swaggerci/storage/generated/runtime/BuildTime/Models/PsProxyTypes.cs new file mode 100644 index 000000000000..41072f4ff752 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/Models/PsProxyTypes.cs @@ -0,0 +1,514 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Reflection; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsProxyOutputExtensions; +using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell.PsProxyTypeExtensions; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal class ProfileGroup + { + public string ProfileName { get; } + public Variant[] Variants { get; } + public string ProfileFolder { get; } + + public ProfileGroup(Variant[] variants, string profileName = NoProfiles) + { + ProfileName = profileName; + Variants = variants; + ProfileFolder = ProfileName != NoProfiles ? ProfileName : String.Empty; + } + } + + internal class VariantGroup + { + public string ModuleName { get; } + + public string RootModuleName {get => @"";} + public string CmdletName { get; } + public string CmdletVerb { get; } + public string CmdletNoun { get; } + public string ProfileName { get; } + public Variant[] Variants { get; } + public ParameterGroup[] ParameterGroups { get; } + public ComplexInterfaceInfo[] ComplexInterfaceInfos { get; } + + public string[] Aliases { get; } + public PSTypeName[] OutputTypes { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + public string DefaultParameterSetName { get; } + public bool HasMultipleVariants { get; } + public PsHelpInfo HelpInfo { get; } + public bool IsGenerated { get; } + public bool IsInternal { get; } + + public string OutputFolder { get; } + public string FileName { get; } + public string FilePath { get; } + + public CommentInfo CommentInfo { get; } + + public VariantGroup(string moduleName, string cmdletName, Variant[] variants, string outputFolder, string profileName = NoProfiles, bool isTest = false, bool isInternal = false) + { + ModuleName = moduleName; + CmdletName = cmdletName; + var cmdletNameParts = CmdletName.Split('-'); + CmdletVerb = cmdletNameParts.First(); + CmdletNoun = cmdletNameParts.Last(); + ProfileName = profileName; + Variants = variants; + ParameterGroups = Variants.ToParameterGroups().OrderBy(pg => pg.OrderCategory).ThenByDescending(pg => pg.IsMandatory).ToArray(); + var aliasDuplicates = ParameterGroups.SelectMany(pg => pg.Aliases) + //https://stackoverflow.com/a/18547390/294804 + .GroupBy(a => a).Where(g => g.Count() > 1).Select(g => g.Key).ToArray(); + if (aliasDuplicates.Any()) + { + throw new ParsingMetadataException($"The alias(es) [{String.Join(", ", aliasDuplicates)}] are defined on multiple parameters for cmdlet '{CmdletName}', which is not supported."); + } + ComplexInterfaceInfos = ParameterGroups.Where(pg => !pg.DontShow && pg.IsComplexInterface).OrderBy(pg => pg.ParameterName).Select(pg => pg.ComplexInterfaceInfo).ToArray(); + + Aliases = Variants.SelectMany(v => v.Attributes).ToAliasNames().ToArray(); + OutputTypes = Variants.SelectMany(v => v.Info.OutputType).Where(ot => ot.Type != null).GroupBy(ot => ot.Type).Select(otg => otg.First()).ToArray(); + SupportsShouldProcess = Variants.Any(v => v.SupportsShouldProcess); + SupportsPaging = Variants.Any(v => v.SupportsPaging); + DefaultParameterSetName = DetermineDefaultParameterSetName(); + HasMultipleVariants = Variants.Length > 1; + HelpInfo = Variants.Select(v => v.HelpInfo).FirstOrDefault() ?? new PsHelpInfo(); + IsGenerated = Variants.All(v => v.Attributes.OfType().Any()); + IsInternal = isInternal; + + OutputFolder = outputFolder; + FileName = $"{CmdletName}{(isTest ? ".Tests" : String.Empty)}.ps1"; + FilePath = Path.Combine(OutputFolder, FileName); + + CommentInfo = new CommentInfo(this); + } + + private string DetermineDefaultParameterSetName() + { + var defaultParameterSet = Variants + .Select(v => v.Metadata.DefaultParameterSetName) + .LastOrDefault(dpsn => dpsn.IsValidDefaultParameterSetName()); + + if (String.IsNullOrEmpty(defaultParameterSet)) + { + var variantParamCountGroups = Variants + .Select(v => ( + variant: v.VariantName, + paramCount: v.CmdletOnlyParameters.Count(p => p.IsMandatory), + isSimple: v.CmdletOnlyParameters.Where(p => p.IsMandatory).All(p => p.ParameterType.IsPsSimple()))) + .GroupBy(vpc => vpc.isSimple) + .ToArray(); + var variantParameterCounts = (variantParamCountGroups.Any(g => g.Key) ? variantParamCountGroups.Where(g => g.Key) : variantParamCountGroups).SelectMany(g => g).ToArray(); + var smallestParameterCount = variantParameterCounts.Min(vpc => vpc.paramCount); + defaultParameterSet = variantParameterCounts.First(vpc => vpc.paramCount == smallestParameterCount).variant; + } + + return defaultParameterSet; + } + } + + internal class Variant + { + public string CmdletName { get; } + public string VariantName { get; } + public CommandInfo Info { get; } + public CommandMetadata Metadata { get; } + public PsHelpInfo HelpInfo { get; } + public bool HasParameterSets { get; } + public bool IsFunction { get; } + public string PrivateModuleName { get; } + public string PrivateCmdletName { get; } + public bool SupportsShouldProcess { get; } + public bool SupportsPaging { get; } + + public Attribute[] Attributes { get; } + public Parameter[] Parameters { get; } + public Parameter[] CmdletOnlyParameters { get; } + public bool IsInternal { get; } + public bool IsDoNotExport { get; } + public string[] Profiles { get; } + + public Variant(string cmdletName, string variantName, CommandInfo info, CommandMetadata metadata, bool hasParameterSets = false, PsHelpInfo helpInfo = null) + { + CmdletName = cmdletName; + VariantName = variantName; + Info = info; + HelpInfo = helpInfo ?? new PsHelpInfo(); + Metadata = metadata; + HasParameterSets = hasParameterSets; + IsFunction = Info.CommandType == CommandTypes.Function; + PrivateModuleName = Info.Source; + PrivateCmdletName = Metadata.Name; + SupportsShouldProcess = Metadata.SupportsShouldProcess; + SupportsPaging = Metadata.SupportsPaging; + + Attributes = this.ToAttributes(); + Parameters = this.ToParameters().OrderBy(p => p.OrderCategory).ThenByDescending(p => p.IsMandatory).ToArray(); + IsInternal = Attributes.OfType().Any(); + IsDoNotExport = Attributes.OfType().Any(); + CmdletOnlyParameters = Parameters.Where(p => !p.Categories.Any(c => c == ParameterCategory.Azure || c == ParameterCategory.Runtime)).ToArray(); + Profiles = Attributes.OfType().SelectMany(pa => pa.Profiles).ToArray(); + } + } + + internal class ParameterGroup + { + public string ParameterName { get; } + public Parameter[] Parameters { get; } + + public string[] VariantNames { get; } + public string[] AllVariantNames { get; } + public bool HasAllVariants { get; } + public Type ParameterType { get; } + public string Description { get; } + + public string[] Aliases { get; } + public bool HasValidateNotNull { get; } + public bool HasAllowEmptyArray { get; } + public CompleterInfo CompleterInfo { get; } + public DefaultInfo DefaultInfo { get; } + public bool HasDefaultInfo { get; } + public ParameterCategory OrderCategory { get; } + public bool DontShow { get; } + public bool IsMandatory { get; } + public bool SupportsWildcards { get; } + public bool IsComplexInterface { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public InfoAttribute InfoAttribute { get; } + + public int? FirstPosition { get; } + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public bool IsInputType { get; } + + public ParameterGroup(string parameterName, Parameter[] parameters, string[] allVariantNames) + { + ParameterName = parameterName; + Parameters = parameters; + + VariantNames = Parameters.Select(p => p.VariantName).ToArray(); + AllVariantNames = allVariantNames; + HasAllVariants = VariantNames.Any(vn => vn == AllParameterSets) || !AllVariantNames.Except(VariantNames).Any(); + var types = Parameters.Select(p => p.ParameterType).Distinct().ToArray(); + if (types.Length > 1) + { + throw new ParsingMetadataException($"The parameter '{ParameterName}' has multiple parameter types [{String.Join(", ", types.Select(t => t.Name))}] defined, which is not supported."); + } + ParameterType = types.First(); + Description = Parameters.Select(p => p.Description).FirstOrDefault(d => !String.IsNullOrEmpty(d)).EmptyIfNull(); + + Aliases = Parameters.SelectMany(p => p.Attributes).ToAliasNames().ToArray(); + HasValidateNotNull = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + HasAllowEmptyArray = Parameters.SelectMany(p => p.Attributes.OfType()).Any(); + CompleterInfo = Parameters.Select(p => p.CompleterInfoAttribute).FirstOrDefault()?.ToCompleterInfo() + ?? Parameters.Select(p => p.ArgumentCompleterAttribute).FirstOrDefault()?.ToCompleterInfo(); + DefaultInfo = Parameters.Select(p => p.DefaultInfoAttribute).FirstOrDefault()?.ToDefaultInfo(this) + ?? Parameters.Select(p => p.DefaultValueAttribute).FirstOrDefault(dv => dv != null)?.ToDefaultInfo(this); + HasDefaultInfo = DefaultInfo != null && !String.IsNullOrEmpty(DefaultInfo.Script); + // When DefaultInfo is present, force all parameters from this group to be optional. + if (HasDefaultInfo) + { + foreach (var parameter in Parameters) + { + parameter.IsMandatory = false; + } + } + OrderCategory = Parameters.Select(p => p.OrderCategory).Distinct().DefaultIfEmpty(ParameterCategory.Body).Min(); + DontShow = Parameters.All(p => p.DontShow); + IsMandatory = HasAllVariants && Parameters.Any(p => p.IsMandatory); + SupportsWildcards = Parameters.Any(p => p.SupportsWildcards); + IsComplexInterface = Parameters.Any(p => p.IsComplexInterface); + ComplexInterfaceInfo = Parameters.Where(p => p.IsComplexInterface).Select(p => p.ComplexInterfaceInfo).FirstOrDefault(); + InfoAttribute = Parameters.Select(p => p.InfoAttribute).First(); + + FirstPosition = Parameters.Select(p => p.Position).FirstOrDefault(p => p != null); + ValueFromPipeline = Parameters.Any(p => p.ValueFromPipeline); + ValueFromPipelineByPropertyName = Parameters.Any(p => p.ValueFromPipelineByPropertyName); + IsInputType = ValueFromPipeline || ValueFromPipelineByPropertyName; + } + } + + internal class Parameter + { + public string VariantName { get; } + public string ParameterName { get; } + public ParameterMetadata Metadata { get; } + public PsParameterHelpInfo HelpInfo { get; } + public Type ParameterType { get; } + + public Attribute[] Attributes { get; } + public ParameterCategory[] Categories { get; } + public ParameterCategory OrderCategory { get; } + public PSDefaultValueAttribute DefaultValueAttribute { get; } + public DefaultInfoAttribute DefaultInfoAttribute { get; } + public ParameterAttribute ParameterAttribute { get; } + public bool SupportsWildcards { get; } + public CompleterInfoAttribute CompleterInfoAttribute { get; } + public ArgumentCompleterAttribute ArgumentCompleterAttribute { get; } + + public bool ValueFromPipeline { get; } + public bool ValueFromPipelineByPropertyName { get; } + public int? Position { get; } + public bool DontShow { get; } + public bool IsMandatory { get; set; } + + public InfoAttribute InfoAttribute { get; } + public ComplexInterfaceInfo ComplexInterfaceInfo { get; } + public bool IsComplexInterface { get; } + public string Description { get; } + + public Parameter(string variantName, string parameterName, ParameterMetadata metadata, PsParameterHelpInfo helpInfo = null) + { + VariantName = variantName; + ParameterName = parameterName; + Metadata = metadata; + HelpInfo = helpInfo ?? new PsParameterHelpInfo(); + + Attributes = Metadata.Attributes.ToArray(); + ParameterType = Attributes.OfType().FirstOrDefault()?.Type ?? Metadata.ParameterType; + Categories = Attributes.OfType().SelectMany(ca => ca.Categories).Distinct().ToArray(); + OrderCategory = Categories.DefaultIfEmpty(ParameterCategory.Body).Min(); + DefaultValueAttribute = Attributes.OfType().FirstOrDefault(); + DefaultInfoAttribute = Attributes.OfType().FirstOrDefault(); + ParameterAttribute = Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == VariantName || pa.ParameterSetName == AllParameterSets); + if (ParameterAttribute == null) + { + throw new ParsingMetadataException($"The variant '{VariantName}' has multiple parameter sets defined, which is not supported."); + } + SupportsWildcards = Attributes.OfType().Any(); + CompleterInfoAttribute = Attributes.OfType().FirstOrDefault(); + ArgumentCompleterAttribute = Attributes.OfType().FirstOrDefault(); + + ValueFromPipeline = ParameterAttribute.ValueFromPipeline; + ValueFromPipelineByPropertyName = ParameterAttribute.ValueFromPipelineByPropertyName; + Position = ParameterAttribute.Position == Int32.MinValue ? (int?)null : ParameterAttribute.Position; + DontShow = ParameterAttribute.DontShow; + IsMandatory = ParameterAttribute.Mandatory; + + var complexParameterName = ParameterName.ToUpperInvariant(); + var complexMessage = $"{Environment.NewLine}To construct, see NOTES section for {complexParameterName} properties and create a hash table."; + var description = ParameterAttribute.HelpMessage.NullIfEmpty() ?? HelpInfo.Description.NullIfEmpty() ?? InfoAttribute?.Description.NullIfEmpty() ?? String.Empty; + // Remove the complex type message as it will be reinserted if this is a complex type + description = description.NormalizeNewLines().Replace(complexMessage, String.Empty).Replace(complexMessage.ToPsSingleLine(), String.Empty); + // Make an InfoAttribute for processing only if one isn't provided + InfoAttribute = Attributes.OfType().FirstOrDefault() ?? new InfoAttribute { PossibleTypes = new[] { ParameterType.Unwrap() }, Required = IsMandatory }; + // Set the description if the InfoAttribute does not have one since they are exported without a description + InfoAttribute.Description = String.IsNullOrEmpty(InfoAttribute.Description) ? description : InfoAttribute.Description; + ComplexInterfaceInfo = InfoAttribute.ToComplexInterfaceInfo(complexParameterName, ParameterType, true); + IsComplexInterface = ComplexInterfaceInfo.IsComplexInterface; + Description = $"{description}{(IsComplexInterface ? complexMessage : String.Empty)}"; + } + } + + internal class ComplexInterfaceInfo + { + public InfoAttribute InfoAttribute { get; } + + public string Name { get; } + public Type Type { get; } + public bool Required { get; } + public bool ReadOnly { get; } + public string Description { get; } + + public ComplexInterfaceInfo[] NestedInfos { get; } + public bool IsComplexInterface { get; } + + public ComplexInterfaceInfo(string name, Type type, InfoAttribute infoAttribute, bool? required, List seenTypes) + { + Name = name; + Type = type; + InfoAttribute = infoAttribute; + + Required = required ?? InfoAttribute.Required; + ReadOnly = InfoAttribute.ReadOnly; + Description = InfoAttribute.Description.ToPsSingleLine(); + + var unwrappedType = Type.Unwrap(); + var hasBeenSeen = seenTypes?.Contains(unwrappedType) ?? false; + (seenTypes ?? (seenTypes = new List())).Add(unwrappedType); + NestedInfos = hasBeenSeen ? new ComplexInterfaceInfo[]{} : + unwrappedType.GetInterfaces() + .Concat(InfoAttribute.PossibleTypes) + .SelectMany(pt => pt.GetProperties() + .SelectMany(pi => pi.GetCustomAttributes(true).OfType() + .Select(ia => ia.ToComplexInterfaceInfo(pi.Name, pi.PropertyType, seenTypes: seenTypes)))) + .Where(cii => !cii.ReadOnly).OrderByDescending(cii => cii.Required).ToArray(); + // https://stackoverflow.com/a/503359/294804 + var associativeArrayInnerType = Type.GetInterfaces() + .FirstOrDefault(i => i.IsGenericType && i.GetGenericTypeDefinition() == typeof(IAssociativeArray<>)) + ?.GetTypeInfo().GetGenericArguments().First(); + if (!hasBeenSeen && associativeArrayInnerType != null) + { + var anyInfo = new InfoAttribute { Description = "This indicates any property can be added to this object." }; + NestedInfos = NestedInfos.Prepend(anyInfo.ToComplexInterfaceInfo("(Any)", associativeArrayInnerType)).ToArray(); + } + IsComplexInterface = NestedInfos.Any(); + } + } + + internal class CommentInfo + { + public string Description { get; } + public string Synopsis { get; } + + public string[] Examples { get; } + public string[] Inputs { get; } + public string[] Outputs { get; } + + public string OnlineVersion { get; } + public string[] RelatedLinks { get; } + + private const string HelpLinkPrefix = @"https://docs.microsoft.com/en-us/powershell/module/"; + + public CommentInfo(VariantGroup variantGroup) + { + var helpInfo = variantGroup.HelpInfo; + Description = variantGroup.Variants.SelectMany(v => v.Attributes).OfType().FirstOrDefault()?.Description.NullIfEmpty() + ?? helpInfo.Description.EmptyIfNull(); + // If there is no Synopsis, PowerShell may put in the Syntax string as the Synopsis. This seems unintended, so we remove the Synopsis in this situation. + var synopsis = helpInfo.Synopsis.EmptyIfNull().Trim().StartsWith(variantGroup.CmdletName) ? String.Empty : helpInfo.Synopsis; + Synopsis = synopsis.NullIfEmpty() ?? Description; + + Examples = helpInfo.Examples.Select(rl => rl.Code).ToArray(); + + Inputs = (variantGroup.ParameterGroups.Where(pg => pg.IsInputType).Select(pg => pg.ParameterType.FullName).ToArray().NullIfEmpty() ?? + helpInfo.InputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(it => it.Name).ToArray()) + .Where(i => i != "None").Distinct().OrderBy(i => i).ToArray(); + Outputs = (variantGroup.OutputTypes.Select(ot => ot.Type.FullName).ToArray().NullIfEmpty() ?? + helpInfo.OutputTypes.Where(it => it.Name.NullIfWhiteSpace() != null).Select(ot => ot.Name).ToArray()) + .Where(o => o != "None").Distinct().OrderBy(o => o).ToArray(); + + // Use root module name in the help link + var moduleName = variantGroup.RootModuleName == "" ? variantGroup.ModuleName.ToLowerInvariant() : variantGroup.RootModuleName.ToLowerInvariant(); + OnlineVersion = helpInfo.OnlineVersion?.Uri.NullIfEmpty() ?? $@"{HelpLinkPrefix}{moduleName}/{variantGroup.CmdletName.ToLowerInvariant()}"; + RelatedLinks = helpInfo.RelatedLinks.Select(rl => rl.Text).ToArray(); + } + } + + internal class CompleterInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public Type Type { get; } + public bool IsTypeCompleter { get; } + + public CompleterInfo(CompleterInfoAttribute infoAttribute) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + } + + public CompleterInfo(ArgumentCompleterAttribute completerAttribute) + { + Script = completerAttribute.ScriptBlock?.ToString(); + if (completerAttribute.Type != null) + { + Type = completerAttribute.Type; + IsTypeCompleter = true; + } + } + } + + internal class DefaultInfo + { + public string Name { get; } + public string Description { get; } + public string Script { get; } + public ParameterGroup ParameterGroup { get; } + + public DefaultInfo(DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) + { + Name = infoAttribute.Name; + Description = infoAttribute.Description; + Script = infoAttribute.Script; + ParameterGroup = parameterGroup; + } + + public DefaultInfo(PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) + { + Description = defaultValueAttribute.Help; + ParameterGroup = parameterGroup; + if (defaultValueAttribute.Value != null) + { + Script = defaultValueAttribute.Value.ToString(); + } + } + } + + internal static class PsProxyTypeExtensions + { + public const string NoProfiles = "__NoProfiles"; + + public static bool IsValidDefaultParameterSetName(this string parameterSetName) => + !String.IsNullOrEmpty(parameterSetName) && parameterSetName != AllParameterSets; + + public static Variant[] ToVariants(this CommandInfo info, PsHelpInfo helpInfo) + { + var metadata = new CommandMetadata(info); + var privateCmdletName = metadata.Name.Split('!').First(); + var parts = privateCmdletName.Split('_'); + return parts.Length > 1 + ? new[] { new Variant(parts[0], parts[1], info, metadata, helpInfo: helpInfo) } + // Process multiple parameter sets, so we declare a variant per parameter set. + : info.ParameterSets.Select(ps => new Variant(privateCmdletName, ps.Name, info, metadata, true, helpInfo)).ToArray(); + } + + public static Variant[] ToVariants(this CmdletAndHelpInfo info) => info.CommandInfo.ToVariants(info.HelpInfo); + + public static Variant[] ToVariants(this CommandInfo info, PSObject helpInfo = null) => info.ToVariants(helpInfo?.ToPsHelpInfo()); + + public static Parameter[] ToParameters(this Variant variant) + { + var parameters = variant.Metadata.Parameters.AsEnumerable(); + var parameterHelp = variant.HelpInfo.Parameters.AsEnumerable(); + + if (variant.HasParameterSets) + { + parameters = parameters.Where(p => p.Value.ParameterSets.Keys.Any(k => k == variant.VariantName || k == AllParameterSets)); + parameterHelp = parameterHelp.Where(ph => (!ph.ParameterSetNames.Any() || ph.ParameterSetNames.Any(psn => psn == variant.VariantName || psn == AllParameterSets)) && ph.Name != "IncludeTotalCount"); + } + var result = parameters.Select(p => new Parameter(variant.VariantName, p.Key, p.Value, parameterHelp.FirstOrDefault(ph => ph.Name == p.Key))); + if (variant.SupportsPaging) { + // If supportsPaging is set, we will need to add First and Skip parameters since they are treated as common parameters which as not contained on Metadata>parameters + variant.Info.Parameters["First"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Gets only the first 'n' objects."; + variant.Info.Parameters["Skip"].Attributes.OfType().FirstOrDefault(pa => pa.ParameterSetName == variant.VariantName || pa.ParameterSetName == AllParameterSets).HelpMessage = "Ignores the first 'n' objects and then gets the remaining objects."; + result = result.Append(new Parameter(variant.VariantName, "First", variant.Info.Parameters["First"], parameterHelp.FirstOrDefault(ph => ph.Name == "First"))); + result = result.Append(new Parameter(variant.VariantName, "Skip", variant.Info.Parameters["Skip"], parameterHelp.FirstOrDefault(ph => ph.Name == "Skip"))); + } + return result.ToArray(); + } + + public static Attribute[] ToAttributes(this Variant variant) => variant.IsFunction + ? ((FunctionInfo)variant.Info).ScriptBlock.Attributes.ToArray() + : variant.Metadata.CommandType.GetCustomAttributes(false).Cast().ToArray(); + + public static IEnumerable ToParameterGroups(this Variant[] variants) + { + var allVariantNames = variants.Select(vg => vg.VariantName).ToArray(); + return variants + .SelectMany(v => v.Parameters) + .GroupBy(p => p.ParameterName, StringComparer.InvariantCultureIgnoreCase) + .Select(pg => new ParameterGroup(pg.Key, pg.Select(p => p).ToArray(), allVariantNames)); + } + + public static ComplexInterfaceInfo ToComplexInterfaceInfo(this InfoAttribute infoAttribute, string name, Type type, bool? required = null, List seenTypes = null) + => new ComplexInterfaceInfo(name, type, infoAttribute, required, seenTypes); + + public static CompleterInfo ToCompleterInfo(this CompleterInfoAttribute infoAttribute) => new CompleterInfo(infoAttribute); + public static CompleterInfo ToCompleterInfo(this ArgumentCompleterAttribute completerAttribute) => new CompleterInfo(completerAttribute); + + public static DefaultInfo ToDefaultInfo(this DefaultInfoAttribute infoAttribute, ParameterGroup parameterGroup) => new DefaultInfo(infoAttribute, parameterGroup); + public static DefaultInfo ToDefaultInfo(this PSDefaultValueAttribute defaultValueAttribute, ParameterGroup parameterGroup) => new DefaultInfo(defaultValueAttribute, parameterGroup); + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/PsAttributes.cs b/swaggerci/storage/generated/runtime/BuildTime/PsAttributes.cs new file mode 100644 index 000000000000..33fc2bbe6d00 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/PsAttributes.cs @@ -0,0 +1,114 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage +{ + [AttributeUsage(AttributeTargets.Class)] + public class DescriptionAttribute : Attribute + { + public string Description { get; } + + public DescriptionAttribute(string description) + { + Description = description; + } + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class InternalExportAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class GeneratedAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property)] + public class DoNotFormatAttribute : Attribute + { + } + + [AttributeUsage(AttributeTargets.Class)] + public class ProfileAttribute : Attribute + { + public string[] Profiles { get; } + + public ProfileAttribute(params string[] profiles) + { + Profiles = profiles; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class CategoryAttribute : Attribute + { + public ParameterCategory[] Categories { get; } + + public CategoryAttribute(params ParameterCategory[] categories) + { + Categories = categories; + } + } + + [AttributeUsage(AttributeTargets.Field | AttributeTargets.Property)] + public class ExportAsAttribute : Attribute + { + public Type Type { get; set; } + + public ExportAsAttribute(Type type) + { + Type = type; + } + } + + public enum ParameterCategory + { + // Note: Order is significant + Uri = 0, + Path, + Query, + Header, + Cookie, + Body, + Azure, + Runtime + } + + [AttributeUsage(AttributeTargets.Property)] + public class OriginAttribute : Attribute + { + public PropertyOrigin Origin { get; } + + public OriginAttribute(PropertyOrigin origin) + { + Origin = origin; + } + } + + public enum PropertyOrigin + { + // Note: Order is significant + Inherited = 0, + Owned, + Inlined + } + + [AttributeUsage(AttributeTargets.Property)] + public class FormatTableAttribute : Attribute + { + public int Index { get; set; } = -1; + public bool HasIndex => Index != -1; + public string Label { get; set; } + public int Width { get; set; } = -1; + public bool HasWidth => Width != -1; + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/PsExtensions.cs b/swaggerci/storage/generated/runtime/BuildTime/PsExtensions.cs new file mode 100644 index 000000000000..29168379578a --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/PsExtensions.cs @@ -0,0 +1,169 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Management.Automation; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal static class PsExtensions + { + // https://stackoverflow.com/a/863944/294804 + // https://stackoverflow.com/a/4452598/294804 + // https://stackoverflow.com/a/28701974/294804 + // Note: This will unwrap nested collections, but we don't generate nested collections. + public static Type Unwrap(this Type type) + { + if (type.IsArray) + { + return type.GetElementType().Unwrap(); + } + + var typeInfo = type.GetTypeInfo(); + if (typeInfo.IsGenericType + && (typeInfo.GetGenericTypeDefinition() == typeof(Nullable<>) || typeof(IEnumerable<>).IsAssignableFrom(type))) + { + return typeInfo.GetGenericArguments().First().Unwrap(); + } + + return type; + } + + // https://stackoverflow.com/a/863944/294804 + private static bool IsSimple(this Type type) + { + var typeInfo = type.GetTypeInfo(); + return typeInfo.IsPrimitive + || typeInfo.IsEnum + || type == typeof(string) + || type == typeof(decimal); + } + + // https://stackoverflow.com/a/32025393/294804 + private static bool HasImplicitConversion(this Type baseType, Type targetType) => + baseType.GetMethods(BindingFlags.Public | BindingFlags.Static) + .Where(mi => mi.Name == "op_Implicit" && mi.ReturnType == targetType) + .Any(mi => mi.GetParameters().FirstOrDefault()?.ParameterType == baseType); + + public static bool IsPsSimple(this Type type) + { + var unwrappedType = type.Unwrap(); + return unwrappedType.IsSimple() + || unwrappedType == typeof(SwitchParameter) + || unwrappedType == typeof(Hashtable) + || unwrappedType == typeof(PSCredential) + || unwrappedType == typeof(ScriptBlock) + || unwrappedType == typeof(DateTime) + || unwrappedType == typeof(Uri) + || unwrappedType.HasImplicitConversion(typeof(string)); + } + + public static string ToPsList(this IEnumerable items) => String.Join(", ", items.Select(i => $"'{i}'")); + + public static IEnumerable ToAliasNames(this IEnumerable attributes) => attributes.OfType().SelectMany(aa => aa.AliasNames).Distinct(); + + public static bool IsArrayAndElementTypeIsT(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return itemType.IsArray && !tType.IsArray && tType.IsAssignableFrom(itemType.GetElementType()); + } + + public static bool IsTArrayAndElementTypeIsItem(this object item) + { + var itemType = item.GetType(); + var tType = typeof(T); + return !itemType.IsArray && tType.IsArray && (tType.GetElementType()?.IsAssignableFrom(itemType) ?? false); + } + + public static bool IsTypeOrArrayOfType(this object item) => item is T || item.IsArrayAndElementTypeIsT() || item.IsTArrayAndElementTypeIsItem(); + + public static T NormalizeArrayType(this object item) + { + if (item is T result) + { + return result; + } + + if (item.IsArrayAndElementTypeIsT()) + { + var array = (T[])Convert.ChangeType(item, typeof(T[])); + return array.FirstOrDefault(); + } + + if (item.IsTArrayAndElementTypeIsItem()) + { + var tType = typeof(T); + var array = Array.CreateInstance(tType.GetElementType(), 1); + array.SetValue(item, 0); + return (T)Convert.ChangeType(array, tType); + } + + return default(T); + } + + public static T GetNestedProperty(this PSObject psObject, params string[] names) => psObject.Properties.GetNestedProperty(names); + + public static T GetNestedProperty(this PSMemberInfoCollection properties, params string[] names) + { + var lastName = names.Last(); + var nestedProperties = names.Take(names.Length - 1).Aggregate(properties, (p, n) => p?.GetProperty(n)?.Properties); + return nestedProperties != null ? nestedProperties.GetProperty(lastName) : default(T); + } + + public static T GetProperty(this PSObject psObject, string name) => psObject.Properties.GetProperty(name); + + public static T GetProperty(this PSMemberInfoCollection properties, string name) + { + switch (properties[name]?.Value) + { + case PSObject psObject when psObject.BaseObject is PSCustomObject && psObject.ImmediateBaseObject.IsTypeOrArrayOfType(): + return psObject.ImmediateBaseObject.NormalizeArrayType(); + case PSObject psObject when psObject.BaseObject.IsTypeOrArrayOfType(): + return psObject.BaseObject.NormalizeArrayType(); + case object value when value.IsTypeOrArrayOfType(): + return value.NormalizeArrayType(); + default: + return default(T); + } + } + + public static IEnumerable RunScript(this PSCmdlet cmdlet, string script) + => PsHelpers.RunScript(cmdlet.InvokeCommand, script); + + public static void RunScript(this PSCmdlet cmdlet, string script) + => cmdlet.RunScript(script); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, string script) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, script); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, string script) + => engineIntrinsics.RunScript(script); + + public static IEnumerable RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => PsHelpers.RunScript(cmdlet.InvokeCommand, block.ToString()); + + public static void RunScript(this PSCmdlet cmdlet, ScriptBlock block) + => cmdlet.RunScript(block.ToString()); + + public static IEnumerable RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => PsHelpers.RunScript(engineIntrinsics.InvokeCommand, block.ToString()); + + public static void RunScript(this EngineIntrinsics engineIntrinsics, ScriptBlock block) + => engineIntrinsics.RunScript(block.ToString()); + + /// + /// Returns if a parameter should be hidden by checking for . + /// + /// A PowerShell parameter. + public static bool IsHidden(this Parameter parameter) + { + return parameter.Attributes.Any(attr => attr is DoNotExportAttribute); + } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/PsHelpers.cs b/swaggerci/storage/generated/runtime/BuildTime/PsHelpers.cs new file mode 100644 index 000000000000..b6a54bda7d0b --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/PsHelpers.cs @@ -0,0 +1,105 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Management.Automation; +using Pwsh = System.Management.Automation.PowerShell; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal static class PsHelpers + { + public static IEnumerable RunScript(string script) + => Pwsh.Create().AddScript(script).Invoke(); + + public static void RunScript(string script) + => RunScript(script); + + public static IEnumerable RunScript(CommandInvocationIntrinsics cii, string script) + => cii.InvokeScript(script).Select(o => o?.BaseObject).Where(o => o != null).OfType(); + + public static void RunScript(CommandInvocationIntrinsics cii, string script) + => RunScript(cii, script); + + public static IEnumerable GetModuleCmdlets(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletsCommand = String.Join(" + ", modulePaths.Select(mp => $"(Get-Command -Module (Import-Module '{mp}' -PassThru))")); + return (cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand)) + .Where(ci => ci.CommandType != CommandTypes.Alias); + } + + public static IEnumerable GetModuleCmdlets(params string[] modulePaths) + => GetModuleCmdlets(null, modulePaths); + + public static IEnumerable GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder) + { + // https://stackoverflow.com/a/40969712/294804 + var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'"; + var getCmdletsCommand = $@" +$currentFunctions = Get-ChildItem function: +Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} +"; + return cmdlet?.RunScript(getCmdletsCommand) ?? RunScript(getCmdletsCommand); + } + + public static IEnumerable GetScriptCmdlets(string scriptFolder) + => GetScriptCmdlets(null, scriptFolder); + + public static IEnumerable GetScriptHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var importModules = String.Join(Environment.NewLine, modulePaths.Select(mp => $"Import-Module '{mp}'")); + var getHelpCommand = $@" +$currentFunctions = Get-ChildItem function: +{importModules} +Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }} | ForEach-Object {{ Get-Help -Name $_.Name -Full }} +"; + return cmdlet?.RunScript(getHelpCommand) ?? RunScript(getHelpCommand); + } + + public static IEnumerable GetScriptHelpInfo(params string[] modulePaths) + => GetScriptHelpInfo(null, modulePaths); + + public static IEnumerable GetModuleCmdletsAndHelpInfo(PSCmdlet cmdlet, params string[] modulePaths) + { + var getCmdletAndHelp = String.Join(" + ", modulePaths.Select(mp => + $@"(Get-Command -Module (Import-Module '{mp}' -PassThru) | Where-Object {{ $_.CommandType -ne 'Alias' }} | ForEach-Object {{ @{{ CommandInfo = $_; HelpInfo = ( invoke-command {{ try {{ Get-Help -Name $_.Name -Full }} catch{{ '' }} }} ) }} }})" + )); + return (cmdlet?.RunScript(getCmdletAndHelp) ?? RunScript(getCmdletAndHelp)) + .Select(h => new CmdletAndHelpInfo { CommandInfo = (h["CommandInfo"] as PSObject)?.BaseObject as CommandInfo, HelpInfo = h["HelpInfo"] as PSObject }); + } + + public static IEnumerable GetModuleCmdletsAndHelpInfo(params string[] modulePaths) + => GetModuleCmdletsAndHelpInfo(null, modulePaths); + + public static CmdletAndHelpInfo ToCmdletAndHelpInfo(this CommandInfo commandInfo, PSObject helpInfo) => new CmdletAndHelpInfo { CommandInfo = commandInfo, HelpInfo = helpInfo }; + + public const string Psd1Indent = " "; + public const string GuidStart = Psd1Indent + "GUID"; + + public static Guid ReadGuidFromPsd1(string psd1Path) + { + var guid = Guid.NewGuid(); + if (File.Exists(psd1Path)) + { + var currentGuid = File.ReadAllLines(psd1Path) + .FirstOrDefault(l => l.StartsWith(GuidStart))?.Split(new[] { " = " }, StringSplitOptions.RemoveEmptyEntries) + .LastOrDefault()?.Replace("'", String.Empty); + guid = currentGuid != null ? Guid.Parse(currentGuid) : guid; + } + + return guid; + } + } + + internal class CmdletAndHelpInfo + { + public CommandInfo CommandInfo { get; set; } + public PSObject HelpInfo { get; set; } + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/StringExtensions.cs b/swaggerci/storage/generated/runtime/BuildTime/StringExtensions.cs new file mode 100644 index 000000000000..acaa215afe2a --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/StringExtensions.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal static class StringExtensions + { + public static string NullIfEmpty(this string text) => String.IsNullOrEmpty(text) ? null : text; + public static string NullIfWhiteSpace(this string text) => String.IsNullOrWhiteSpace(text) ? null : text; + public static string EmptyIfNull(this string text) => text ?? String.Empty; + + public static bool? ToNullableBool(this string text) => String.IsNullOrEmpty(text) ? (bool?)null : Convert.ToBoolean(text.ToLowerInvariant()); + + public static string ToUpperFirstCharacter(this string text) => String.IsNullOrEmpty(text) ? text : $"{text[0].ToString().ToUpperInvariant()}{text.Remove(0, 1)}"; + + public static string ReplaceNewLines(this string value, string replacer = " ", string[] newLineSymbols = null) + => (newLineSymbols ?? new []{ "\r\n", "\n" }).Aggregate(value.EmptyIfNull(), (current, symbol) => current.Replace(symbol, replacer)); + public static string NormalizeNewLines(this string value) => value.ReplaceNewLines("\u00A0").Replace("\u00A0", Environment.NewLine); + } +} diff --git a/swaggerci/storage/generated/runtime/BuildTime/XmlExtensions.cs b/swaggerci/storage/generated/runtime/BuildTime/XmlExtensions.cs new file mode 100644 index 000000000000..0198e73492f4 --- /dev/null +++ b/swaggerci/storage/generated/runtime/BuildTime/XmlExtensions.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal static class XmlExtensions + { + public static string ToXmlString(this T inputObject, bool excludeDeclaration = false) + { + var serializer = new XmlSerializer(typeof(T)); + //https://stackoverflow.com/a/760290/294804 + //https://stackoverflow.com/a/3732234/294804 + var namespaces = new XmlSerializerNamespaces(new[] { XmlQualifiedName.Empty }); + var xmlSettings = new XmlWriterSettings { OmitXmlDeclaration = excludeDeclaration, Indent = true }; + using (var stringWriter = new StringWriter()) + using (var xmlWriter = XmlWriter.Create(stringWriter, xmlSettings)) + { + serializer.Serialize(xmlWriter, inputObject, namespaces); + return stringWriter.ToString(); + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/CmdInfoHandler.cs b/swaggerci/storage/generated/runtime/CmdInfoHandler.cs new file mode 100644 index 000000000000..540393fa936f --- /dev/null +++ b/swaggerci/storage/generated/runtime/CmdInfoHandler.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Management.Automation; +using System.Net.Http; +using System.Threading; +using System.Threading.Tasks; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using NextDelegate = Func, Task>, Task>; + using SignalDelegate = Func, Task>; + + public class CmdInfoHandler + { + private readonly string processRecordId; + private readonly string parameterSetName; + private readonly InvocationInfo invocationInfo; + + public CmdInfoHandler(string processRecordId, InvocationInfo invocationInfo, string parameterSetName) + { + this.processRecordId = processRecordId; + this.parameterSetName = parameterSetName; + this.invocationInfo = invocationInfo; + } + + public Task SendAsync(HttpRequestMessage request, CancellationToken token, Action cancel, SignalDelegate signal, NextDelegate next) + { + request.Headers.Add("x-ms-client-request-id", processRecordId); + request.Headers.Add("CommandName", invocationInfo?.InvocationName); + request.Headers.Add("FullCommandName", invocationInfo?.MyCommand?.Name); + request.Headers.Add("ParameterSetName", parameterSetName); + + // continue with pipeline. + return next(request, token, cancel, signal); + } + } +} diff --git a/swaggerci/storage/generated/runtime/Conversions/ConversionException.cs b/swaggerci/storage/generated/runtime/Conversions/ConversionException.cs new file mode 100644 index 000000000000..49e2c9b87ca3 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/ConversionException.cs @@ -0,0 +1,17 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal class ConversionException : Exception + { + internal ConversionException(string message) + : base(message) { } + + internal ConversionException(JsonNode node, Type targetType) + : base($"Cannot convert '{node.Type}' to a {targetType.Name}") { } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/IJsonConverter.cs b/swaggerci/storage/generated/runtime/Conversions/IJsonConverter.cs new file mode 100644 index 000000000000..497a88b30ba7 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/IJsonConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal interface IJsonConverter + { + JsonNode ToJson(object value); + + object FromJson(JsonNode node); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/BinaryConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/BinaryConverter.cs new file mode 100644 index 000000000000..681bc8db0e12 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/BinaryConverter.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class BinaryConverter : JsonConverter + { + internal override JsonNode ToJson(byte[] value) => new XBinary(value); + + internal override byte[] FromJson(JsonNode node) + { + switch (node.Type) + { + case JsonType.String : return Convert.FromBase64String(node.ToString()); // Base64 Encoded + case JsonType.Binary : return ((XBinary)node).Value; + } + + throw new ConversionException(node, typeof(byte[])); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/BooleanConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/BooleanConverter.cs new file mode 100644 index 000000000000..c178c5308e10 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/BooleanConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class BooleanConverter : JsonConverter + { + internal override JsonNode ToJson(bool value) => new JsonBoolean(value); + + internal override bool FromJson(JsonNode node) => (bool)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/DateTimeConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/DateTimeConverter.cs new file mode 100644 index 000000000000..348a9042eb36 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/DateTimeConverter.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class DateTimeConverter : JsonConverter + { + internal override JsonNode ToJson(DateTime value) + { + return new JsonDate(value); + } + + internal override DateTime FromJson(JsonNode node) => (DateTime)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs new file mode 100644 index 000000000000..2973b3510aa1 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/DateTimeOffsetConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class DateTimeOffsetConverter : JsonConverter + { + internal override JsonNode ToJson(DateTimeOffset value) => new JsonDate(value); + + internal override DateTimeOffset FromJson(JsonNode node) => (DateTimeOffset)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/DecimalConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/DecimalConverter.cs new file mode 100644 index 000000000000..5e821a646ec0 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/DecimalConverter.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class DecimalConverter : JsonConverter + { + internal override JsonNode ToJson(decimal value) => new JsonNumber(value.ToString()); + + internal override decimal FromJson(JsonNode node) + { + return (decimal)node; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/DoubleConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/DoubleConverter.cs new file mode 100644 index 000000000000..021847215ec8 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/DoubleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class DoubleConverter : JsonConverter + { + internal override JsonNode ToJson(double value) => new JsonNumber(value); + + internal override double FromJson(JsonNode node) => (double)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/EnumConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/EnumConverter.cs new file mode 100644 index 000000000000..f8f7b4788637 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/EnumConverter.cs @@ -0,0 +1,30 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class EnumConverter : IJsonConverter + { + private readonly Type type; + + internal EnumConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + } + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + + public object FromJson(JsonNode node) + { + if (node.Type == JsonType.Number) + { + return Enum.ToObject(type, (int)node); + } + + return Enum.Parse(type, node.ToString(), ignoreCase: true); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/GuidConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/GuidConverter.cs new file mode 100644 index 000000000000..4f5c800df560 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/GuidConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class GuidConverter : JsonConverter + { + internal override JsonNode ToJson(Guid value) => new JsonString(value.ToString()); + + internal override Guid FromJson(JsonNode node) => (Guid)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/HashSet'1Converter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/HashSet'1Converter.cs new file mode 100644 index 000000000000..5bc4ed46bc64 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/HashSet'1Converter.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections.Generic; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class HashSetConverter : JsonConverter> + { + internal override JsonNode ToJson(HashSet value) + { + return new XSet(value); + } + + internal override HashSet FromJson(JsonNode node) + { + var collection = node as ICollection; + + if (collection.Count == 0) return null; + + // TODO: Remove Linq depedency + return new HashSet(collection.Cast()); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/Int16Converter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/Int16Converter.cs new file mode 100644 index 000000000000..9f2793703b9c --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/Int16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class Int16Converter : JsonConverter + { + internal override JsonNode ToJson(short value) => new JsonNumber(value); + + internal override short FromJson(JsonNode node) => (short)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/Int32Converter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/Int32Converter.cs new file mode 100644 index 000000000000..5012d60972aa --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/Int32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class Int32Converter : JsonConverter + { + internal override JsonNode ToJson(int value) => new JsonNumber(value); + + internal override int FromJson(JsonNode node) => (int)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/Int64Converter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/Int64Converter.cs new file mode 100644 index 000000000000..bb1df5b11bb5 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/Int64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class Int64Converter : JsonConverter + { + internal override JsonNode ToJson(long value) => new JsonNumber(value); + + internal override long FromJson(JsonNode node) => (long)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/JsonArrayConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/JsonArrayConverter.cs new file mode 100644 index 000000000000..99b14c912104 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/JsonArrayConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class JsonArrayConverter : JsonConverter + { + internal override JsonNode ToJson(JsonArray value) => value; + + internal override JsonArray FromJson(JsonNode node) => (JsonArray)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/JsonObjectConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/JsonObjectConverter.cs new file mode 100644 index 000000000000..13386dd1ccf7 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/JsonObjectConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class JsonObjectConverter : JsonConverter + { + internal override JsonNode ToJson(JsonObject value) => value; + + internal override JsonObject FromJson(JsonNode node) => (JsonObject)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/SingleConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/SingleConverter.cs new file mode 100644 index 000000000000..fcd676a9cc9f --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/SingleConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class SingleConverter : JsonConverter + { + internal override JsonNode ToJson(float value) => new JsonNumber(value.ToString()); + + internal override float FromJson(JsonNode node) => (float)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/StringConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/StringConverter.cs new file mode 100644 index 000000000000..d8cd6e4eb544 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/StringConverter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class StringConverter : JsonConverter + { + internal override JsonNode ToJson(string value) => new JsonString(value); + + internal override string FromJson(JsonNode node) => node.ToString(); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/TimeSpanConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/TimeSpanConverter.cs new file mode 100644 index 000000000000..3bd24b600ef3 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/TimeSpanConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class TimeSpanConverter : JsonConverter + { + internal override JsonNode ToJson(TimeSpan value) => new JsonString(value.ToString()); + + internal override TimeSpan FromJson(JsonNode node) => (TimeSpan)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/UInt16Converter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/UInt16Converter.cs new file mode 100644 index 000000000000..67b7ec0fcf94 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/UInt16Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class UInt16Converter : JsonConverter + { + internal override JsonNode ToJson(ushort value) => new JsonNumber(value); + + internal override ushort FromJson(JsonNode node) => (ushort)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/UInt32Converter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/UInt32Converter.cs new file mode 100644 index 000000000000..3d833b982023 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/UInt32Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class UInt32Converter : JsonConverter + { + internal override JsonNode ToJson(uint value) => new JsonNumber(value); + + internal override uint FromJson(JsonNode node) => (uint)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/UInt64Converter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/UInt64Converter.cs new file mode 100644 index 000000000000..e91c7b3815cc --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/UInt64Converter.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class UInt64Converter : JsonConverter + { + internal override JsonNode ToJson(ulong value) => new JsonNumber(value.ToString()); + + internal override ulong FromJson(JsonNode node) => (ulong)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/Instances/UriConverter.cs b/swaggerci/storage/generated/runtime/Conversions/Instances/UriConverter.cs new file mode 100644 index 000000000000..294cb3d7a861 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/Instances/UriConverter.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class UriConverter : JsonConverter + { + internal override JsonNode ToJson(Uri value) => new JsonString(value.AbsoluteUri); + + internal override Uri FromJson(JsonNode node) => (Uri)node; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/JsonConverter.cs b/swaggerci/storage/generated/runtime/Conversions/JsonConverter.cs new file mode 100644 index 000000000000..fe245d57bb3b --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/JsonConverter.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public abstract class JsonConverter : IJsonConverter + { + internal abstract T FromJson(JsonNode node); + + internal abstract JsonNode ToJson(T value); + + #region IConverter + + object IJsonConverter.FromJson(JsonNode node) => FromJson(node); + + JsonNode IJsonConverter.ToJson(object value) => ToJson((T)value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/JsonConverterAttribute.cs b/swaggerci/storage/generated/runtime/Conversions/JsonConverterAttribute.cs new file mode 100644 index 000000000000..f0907b95fbf6 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/JsonConverterAttribute.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class JsonConverterAttribute : Attribute + { + internal JsonConverterAttribute(Type type) + { + Converter = (IJsonConverter)Activator.CreateInstance(type); + } + + internal IJsonConverter Converter { get; } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/JsonConverterFactory.cs b/swaggerci/storage/generated/runtime/Conversions/JsonConverterFactory.cs new file mode 100644 index 000000000000..61e5d344b5c9 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/JsonConverterFactory.cs @@ -0,0 +1,91 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class JsonConverterFactory + { + private static readonly Dictionary converters = new Dictionary(); + + static JsonConverterFactory() + { + AddInternal(new BooleanConverter()); + AddInternal(new DateTimeConverter()); + AddInternal(new DateTimeOffsetConverter()); + AddInternal(new BinaryConverter()); + AddInternal(new DecimalConverter()); + AddInternal(new DoubleConverter()); + AddInternal(new GuidConverter()); + AddInternal(new Int16Converter()); + AddInternal(new Int32Converter()); + AddInternal(new Int64Converter()); + AddInternal(new SingleConverter()); + AddInternal(new StringConverter()); + AddInternal(new TimeSpanConverter()); + AddInternal(new UInt16Converter()); + AddInternal(new UInt32Converter()); + AddInternal(new UInt64Converter()); + AddInternal(new UriConverter()); + + // Hash sets + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + AddInternal(new HashSetConverter()); + + // JSON + + AddInternal(new JsonObjectConverter()); + AddInternal(new JsonArrayConverter()); + } + + internal static Dictionary Instances => converters; + + internal static IJsonConverter Get(Type type) + { + var details = TypeDetails.Get(type); + + if (details.JsonConverter == null) + { + throw new ConversionException($"No converter found for '{type.Name}'."); + } + + return details.JsonConverter; + } + + internal static bool TryGet(Type type, out IJsonConverter converter) + { + var typeDetails = TypeDetails.Get(type); + + converter = typeDetails.JsonConverter; + + return converter != null; + } + + private static void AddInternal(JsonConverter converter) + => converters.Add(typeof(T), converter); + + private static void AddInternal(IJsonConverter converter) + => converters.Add(typeof(T), converter); + + internal static void Add(JsonConverter converter) + { + if (converter == null) + { + throw new ArgumentNullException(nameof(converter)); + } + + AddInternal(converter); + + var type = TypeDetails.Get(); + + type.JsonConverter = converter; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Conversions/StringLikeConverter.cs b/swaggerci/storage/generated/runtime/Conversions/StringLikeConverter.cs new file mode 100644 index 000000000000..2eccf359731e --- /dev/null +++ b/swaggerci/storage/generated/runtime/Conversions/StringLikeConverter.cs @@ -0,0 +1,45 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class StringLikeConverter : IJsonConverter + { + private readonly Type type; + private readonly MethodInfo parseMethod; + + internal StringLikeConverter(Type type) + { + this.type = type ?? throw new ArgumentNullException(nameof(type)); + this.parseMethod = StringLikeHelper.GetParseMethod(type); + } + + public object FromJson(JsonNode node) => + parseMethod.Invoke(null, new[] { node.ToString() }); + + public JsonNode ToJson(object value) => new JsonString(value.ToString()); + } + + internal static class StringLikeHelper + { + private static readonly Type[] parseMethodParamaterTypes = new[] { typeof(string) }; + + internal static bool IsStringLike(Type type) + { + return GetParseMethod(type) != null; + } + + internal static MethodInfo GetParseMethod(Type type) + { + MethodInfo method = type.GetMethod("Parse", parseMethodParamaterTypes); + + if (method?.IsPublic != true) return null; + + return method; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/IJsonSerializable.cs b/swaggerci/storage/generated/runtime/Customizations/IJsonSerializable.cs new file mode 100644 index 000000000000..8594b09d5b3b --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/IJsonSerializable.cs @@ -0,0 +1,263 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json; +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + public interface IJsonSerializable + { + JsonNode ToJson(JsonObject container = null, SerializationMode serializationMode = SerializationMode.None); + } + internal static class JsonSerializable + { + /// + /// Serializes an enumerable and returns a JsonNode. + /// + /// an IEnumerable collection of items + /// A JsonNode that contains the collection of items serialized. + private static JsonNode ToJsonValue(System.Collections.IEnumerable enumerable) + { + if (enumerable != null) + { + // is it a byte array of some kind? + if (enumerable is System.Collections.Generic.IEnumerable byteEnumerable) + { + return new XBinary(System.Linq.Enumerable.ToArray(byteEnumerable)); + } + + var hasValues = false; + // just create an array of value nodes. + var result = new XNodeArray(); + foreach (var each in enumerable) + { + // we had at least one value. + hasValues = true; + + // try to serialize it. + var node = ToJsonValue(each); + if (null != node) + { + result.Add(node); + } + } + + // if we were able to add values, (or it was just empty), return it. + if (result.Count > 0 || !hasValues) + { + return result; + } + } + + // we couldn't serialize the values. Sorry. + return null; + } + + /// + /// Serializes a valuetype to a JsonNode. + /// + /// a ValueType (ie, a primitive, enum or struct) to be serialized + /// a JsonNode with the serialized value + private static JsonNode ToJsonValue(ValueType vValue) + { + // numeric type + if (vValue is SByte || vValue is Int16 || vValue is Int32 || vValue is Int64 || vValue is Byte || vValue is UInt16 || vValue is UInt32 || vValue is UInt64 || vValue is decimal || vValue is float || vValue is double) + { + return new JsonNumber(vValue.ToString()); + } + + // boolean type + if (vValue is bool bValue) + { + return new JsonBoolean(bValue); + } + + // dates + if (vValue is DateTime dtValue) + { + return new JsonDate(dtValue); + } + + // DictionaryEntity struct type + if (vValue is System.Collections.DictionaryEntry deValue) + { + return new JsonObject { { deValue.Key.ToString(), ToJsonValue(deValue.Value) } }; + } + + // sorry, no idea. + return null; + } + /// + /// Attempts to serialize an object by using ToJson() or ToJsonString() if they exist. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + private static JsonNode TryToJsonValue(dynamic oValue) + { + object jsonValue = null; + dynamic v = oValue; + try + { + jsonValue = v.ToJson().ToString(); + } + catch + { + // no harm... + try + { + jsonValue = v.ToJsonString().ToString(); + } + catch + { + // no worries here either. + } + } + + // if we got something out, let's use it. + if (null != jsonValue) + { + // JsonNumber is really a literal json value. Just don't try to cast that back to an actual number, ok? + return new JsonNumber(jsonValue.ToString()); + } + + return null; + } + + /// + /// Serialize an object by using a variety of methods. + /// + /// the object to be serialized. + /// the serialized JsonNode (if successful), otherwise, null + internal static JsonNode ToJsonValue(object value) + { + // things that implement our interface are preferred. + if (value is Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IJsonSerializable jsonSerializable) + { + return jsonSerializable.ToJson(); + } + + // strings are easy. + if (value is string || value is char) + { + return new JsonString(value.ToString()); + } + + // value types are fairly straightforward (fallback to ToJson()/ToJsonString() or literal JsonString ) + if (value is System.ValueType vValue) + { + return ToJsonValue(vValue) ?? TryToJsonValue(vValue) ?? new JsonString(vValue.ToString()); + } + + // dictionaries are objects that should be able to serialize + if (value is System.Collections.Generic.IDictionary dictionary) + { + return Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson(dictionary, null); + } + + // hashtables are converted to dictionaries for serialization + if (value is System.Collections.Hashtable hashtable) + { + var dict = new System.Collections.Generic.Dictionary(); + DictionaryExtensions.HashTableToDictionary(hashtable, dict); + return Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.ToJson(dict, null); + } + + // enumerable collections are handled like arrays (again, fallback to ToJson()/ToJsonString() or literal JsonString) + if (value is System.Collections.IEnumerable enumerableValue) + { + // some kind of enumerable value + return ToJsonValue(enumerableValue) ?? TryToJsonValue(value) ?? new JsonString(value.ToString()); + } + + // at this point, we're going to fallback to a string literal here, since we really have no idea what it is. + return new JsonString(value.ToString()); + } + + internal static JsonObject ToJson(System.Collections.Generic.Dictionary dictionary, JsonObject container) => ToJson((System.Collections.Generic.IDictionary)dictionary, container); + + /// + /// Serializes a dictionary into a JsonObject container. + /// + /// The dictionary to serailize + /// the container to serialize the dictionary into + /// the container + internal static JsonObject ToJson(System.Collections.Generic.IDictionary dictionary, JsonObject container) + { + container = container ?? new JsonObject(); + if (dictionary != null && dictionary.Count > 0) + { + foreach (var key in dictionary) + { + // currently, we don't serialize null values. + if (null != key.Value) + { + container.Add(key.Key, ToJsonValue(key.Value)); + continue; + } + } + } + return container; + } + + internal static Func> DeserializeDictionary(Func> dictionaryFactory) + { + return (node) => FromJson(node, dictionaryFactory(), (object)(DeserializeDictionary(dictionaryFactory)) as Func); + } + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.Dictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) => FromJson(json, (System.Collections.Generic.IDictionary)container, objectFactory, excludes); + + + internal static System.Collections.Generic.IDictionary FromJson(JsonObject json, System.Collections.Generic.IDictionary container, System.Func objectFactory, System.Collections.Generic.HashSet excludes = null) + { + if (null == json) + { + return container; + } + + foreach (var key in json.Keys) + { + if (true == excludes?.Contains(key)) + { + continue; + } + + var value = json[key]; + try + { + switch (value.Type) + { + case JsonType.Null: + // skip null values. + continue; + + case JsonType.Array: + case JsonType.Boolean: + case JsonType.Date: + case JsonType.Binary: + case JsonType.Number: + case JsonType.String: + container.Add(key, (V)value.ToValue()); + break; + case JsonType.Object: + if (objectFactory != null) + { + var v = objectFactory(value as JsonObject); + if (null != v) + { + container.Add(key, v); + } + } + break; + } + } + catch + { + } + } + return container; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/JsonArray.cs b/swaggerci/storage/generated/runtime/Customizations/JsonArray.cs new file mode 100644 index 000000000000..b2203df7214a --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/JsonArray.cs @@ -0,0 +1,13 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public partial class JsonArray + { + internal override object ToValue() => Count == 0 ? new object[0] : System.Linq.Enumerable.ToArray(System.Linq.Enumerable.Select(this, each => each.ToValue())); + } + + +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/JsonBoolean.cs b/swaggerci/storage/generated/runtime/Customizations/JsonBoolean.cs new file mode 100644 index 000000000000..26bcf9513b43 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/JsonBoolean.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal partial class JsonBoolean + { + internal static JsonBoolean Create(bool? value) => value is bool b ? new JsonBoolean(b) : null; + internal bool ToBoolean() => Value; + + internal override object ToValue() => Value; + } + + +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/JsonNode.cs b/swaggerci/storage/generated/runtime/Customizations/JsonNode.cs new file mode 100644 index 000000000000..0aa63b5fc636 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/JsonNode.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonNode + { + /// + /// Returns the content of this node as the underlying value. + /// Will default to the string representation if not overridden in child classes. + /// + /// an object with the underlying value of the node. + internal virtual object ToValue() { + return this.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/JsonNumber.cs b/swaggerci/storage/generated/runtime/Customizations/JsonNumber.cs new file mode 100644 index 000000000000..19b1c919858e --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/JsonNumber.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + using System; + + public partial class JsonNumber + { + internal static readonly DateTime EpochDate = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); + private static long ToUnixTime(DateTime dateTime) + { + return (long)dateTime.Subtract(EpochDate).TotalSeconds; + } + private static DateTime FromUnixTime(long totalSeconds) + { + return EpochDate.AddSeconds(totalSeconds); + } + internal byte ToByte() => this; + internal int ToInt() => this; + internal long ToLong() => this; + internal short ToShort() => this; + internal UInt16 ToUInt16() => this; + internal UInt32 ToUInt32() => this; + internal UInt64 ToUInt64() => this; + internal decimal ToDecimal() => this; + internal double ToDouble() => this; + internal float ToFloat() => this; + + internal static JsonNumber Create(int? value) => value is int n ? new JsonNumber(n) : null; + internal static JsonNumber Create(long? value) => value is long n ? new JsonNumber(n) : null; + internal static JsonNumber Create(float? value) => value is float n ? new JsonNumber(n) : null; + internal static JsonNumber Create(double? value) => value is double n ? new JsonNumber(n) : null; + internal static JsonNumber Create(decimal? value) => value is decimal n ? new JsonNumber(n) : null; + internal static JsonNumber Create(DateTime? value) => value is DateTime date ? new JsonNumber(ToUnixTime(date)) : null; + + public static implicit operator DateTime(JsonNumber number) => FromUnixTime(number); + internal DateTime ToDateTime() => this; + + internal JsonNumber(decimal value) + { + this.value = value.ToString(); + } + internal override object ToValue() + { + if (IsInteger) + { + if (int.TryParse(this.value, out int iValue)) + { + return iValue; + } + if (long.TryParse(this.value, out long lValue)) + { + return lValue; + } + } + else + { + if (float.TryParse(this.value, out float fValue)) + { + return fValue; + } + if (double.TryParse(this.value, out double dValue)) + { + return dValue; + } + if (decimal.TryParse(this.value, out decimal dcValue)) + { + return dcValue; + } + } + return null; + } + } + + +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/JsonObject.cs b/swaggerci/storage/generated/runtime/Customizations/JsonObject.cs new file mode 100644 index 000000000000..ee38d67ea11b --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/JsonObject.cs @@ -0,0 +1,183 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + using System; + using System.Collections.Generic; + + public partial class JsonObject + { + internal override object ToValue() => Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.JsonSerializable.FromJson(this, new System.Collections.Generic.Dictionary(), (obj) => obj.ToValue()); + + internal void SafeAdd(string name, Func valueFn) + { + if (valueFn != null) + { + var value = valueFn(); + if (null != value) + { + items.Add(name, value); + } + } + } + + internal void SafeAdd(string name, JsonNode value) + { + if (null != value) + { + items.Add(name, value); + } + } + + internal T NullableProperty(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; + } + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + //throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal JsonObject Property(string propertyName) + { + return PropertyT(propertyName); + } + + internal T PropertyT(string propertyName) where T : JsonNode + { + if (this.TryGetValue(propertyName, out JsonNode value)) + { + if (value.IsNull) + { + return null; // we're going to assume that the consumer knows what to do if null is explicity returned? + } + + if (value is T tval) + { + return tval; + } + /* it's present, but not the correct type... */ + // throw new Exception($"Property {propertyName} in object expected type {typeof(T).Name} but value of type {value.Type.ToString()} was found."); + } + return null; + } + + internal int NumberProperty(string propertyName, ref int output) => output = this.PropertyT(propertyName)?.ToInt() ?? output; + internal float NumberProperty(string propertyName, ref float output) => output = this.PropertyT(propertyName)?.ToFloat() ?? output; + internal byte NumberProperty(string propertyName, ref byte output) => output = this.PropertyT(propertyName)?.ToByte() ?? output; + internal long NumberProperty(string propertyName, ref long output) => output = this.PropertyT(propertyName)?.ToLong() ?? output; + internal double NumberProperty(string propertyName, ref double output) => output = this.PropertyT(propertyName)?.ToDouble() ?? output; + internal decimal NumberProperty(string propertyName, ref decimal output) => output = this.PropertyT(propertyName)?.ToDecimal() ?? output; + internal short NumberProperty(string propertyName, ref short output) => output = this.PropertyT(propertyName)?.ToShort() ?? output; + internal DateTime NumberProperty(string propertyName, ref DateTime output) => output = this.PropertyT(propertyName)?.ToDateTime() ?? output; + + internal int? NumberProperty(string propertyName, ref int? output) => output = this.NullableProperty(propertyName)?.ToInt() ?? null; + internal float? NumberProperty(string propertyName, ref float? output) => output = this.NullableProperty(propertyName)?.ToFloat() ?? null; + internal byte? NumberProperty(string propertyName, ref byte? output) => output = this.NullableProperty(propertyName)?.ToByte() ?? null; + internal long? NumberProperty(string propertyName, ref long? output) => output = this.NullableProperty(propertyName)?.ToLong() ?? null; + internal double? NumberProperty(string propertyName, ref double? output) => output = this.NullableProperty(propertyName)?.ToDouble() ?? null; + internal decimal? NumberProperty(string propertyName, ref decimal? output) => output = this.NullableProperty(propertyName)?.ToDecimal() ?? null; + internal short? NumberProperty(string propertyName, ref short? output) => output = this.NullableProperty(propertyName)?.ToShort() ?? null; + + internal DateTime? NumberProperty(string propertyName, ref DateTime? output) => output = this.NullableProperty(propertyName)?.ToDateTime() ?? null; + + + internal string StringProperty(string propertyName) => this.PropertyT(propertyName)?.ToString(); + internal string StringProperty(string propertyName, ref string output) => output = this.PropertyT(propertyName)?.ToString() ?? output; + internal char StringProperty(string propertyName, ref char output) => output = this.PropertyT(propertyName)?.ToChar() ?? output; + internal char? StringProperty(string propertyName, ref char? output) => output = this.PropertyT(propertyName)?.ToChar() ?? null; + + internal DateTime StringProperty(string propertyName, ref DateTime output) => DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out output) ? output : output; + internal DateTime? StringProperty(string propertyName, ref DateTime? output) => output = DateTime.TryParse(this.PropertyT(propertyName)?.ToString(), out var o) ? o : output; + + + internal bool BooleanProperty(string propertyName, ref bool output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? output; + internal bool? BooleanProperty(string propertyName, ref bool? output) => output = this.PropertyT(propertyName)?.ToBoolean() ?? null; + + internal T[] ArrayProperty(string propertyName, ref T[] output, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + } + return output; + } + internal T[] ArrayProperty(string propertyName, Func deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + var output = new T[array.Count]; + for (var i = 0; i < output.Length; i++) + { + output[i] = deserializer(array[i]); + } + return output; + } + return new T[0]; + } + internal void IterateArrayProperty(string propertyName, Action deserializer) + { + var array = this.PropertyT(propertyName); + if (array != null) + { + for (var i = 0; i < array.Count; i++) + { + deserializer(array[i]); + } + } + } + + internal Dictionary DictionaryProperty(string propertyName, ref Dictionary output, Func deserializer) + { + var dictionary = this.PropertyT(propertyName); + if (output == null) + { + output = new Dictionary(); + } + else + { + output.Clear(); + } + if (dictionary != null) + { + foreach (var key in dictionary.Keys) + { + output[key] = deserializer(dictionary[key]); + } + } + return output; + } + + internal static JsonObject Create(IDictionary source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new JsonObject(); + + foreach (var key in source.Keys) + { + result.SafeAdd(key, selector(source[key])); + } + return result; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/JsonString.cs b/swaggerci/storage/generated/runtime/Customizations/JsonString.cs new file mode 100644 index 000000000000..d25574080724 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/JsonString.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + using System; + using System.Globalization; + using System.Linq; + + public partial class JsonString + { + internal static string DateFormat = "yyyy-MM-dd"; + internal static string DateTimeFormat = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK"; + internal static string DateTimeRfc1123Format = "R"; + + internal static JsonString Create(string value) => value == null ? null : new JsonString(value); + internal static JsonString Create(char? value) => value is char c ? new JsonString(c.ToString()) : null; + + internal static JsonString CreateDate(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTime(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeFormat, CultureInfo.CurrentCulture)) : null; + internal static JsonString CreateDateTimeRfc1123(DateTime? value) => value is DateTime date ? new JsonString(date.ToString(DateTimeRfc1123Format, CultureInfo.CurrentCulture)) : null; + + internal char ToChar() => this.Value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char(JsonString value) => value?.ToString()?.FirstOrDefault() ?? default(char); + public static implicit operator char? (JsonString value) => value?.ToString()?.FirstOrDefault(); + + public static implicit operator DateTime(JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime); + public static implicit operator DateTime? (JsonString value) => DateTime.TryParse(value, out var output) ? output : default(DateTime?); + + } + + +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Customizations/XNodeArray.cs b/swaggerci/storage/generated/runtime/Customizations/XNodeArray.cs new file mode 100644 index 000000000000..625abbeb725c --- /dev/null +++ b/swaggerci/storage/generated/runtime/Customizations/XNodeArray.cs @@ -0,0 +1,44 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + using System; + using System.Linq; + + public partial class XNodeArray + { + internal static XNodeArray Create(T[] source, Func selector) + { + if (source == null || selector == null) + { + return null; + } + var result = new XNodeArray(); + foreach (var item in source.Select(selector)) + { + result.SafeAdd(item); + } + return result; + } + internal void SafeAdd(JsonNode item) + { + if (item != null) + { + items.Add(item); + } + } + internal void SafeAdd(Func itemFn) + { + if (itemFn != null) + { + var item = itemFn(); + if (item != null) + { + items.Add(item); + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Debugging.cs b/swaggerci/storage/generated/runtime/Debugging.cs new file mode 100644 index 000000000000..7681b20d18ba --- /dev/null +++ b/swaggerci/storage/generated/runtime/Debugging.cs @@ -0,0 +1,28 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + internal static class AttachDebugger + { + internal static void Break() + { + while (!System.Diagnostics.Debugger.IsAttached) + { + System.Console.Error.WriteLine($"Waiting for debugger to attach to process {System.Diagnostics.Process.GetCurrentProcess().Id}"); + for (int i = 0; i < 50; i++) + { + if (System.Diagnostics.Debugger.IsAttached) + { + break; + } + System.Threading.Thread.Sleep(100); + System.Console.Error.Write("."); + } + System.Console.Error.WriteLine(); + } + System.Diagnostics.Debugger.Break(); + } + } +} diff --git a/swaggerci/storage/generated/runtime/DictionaryExtensions.cs b/swaggerci/storage/generated/runtime/DictionaryExtensions.cs new file mode 100644 index 000000000000..956250092aff --- /dev/null +++ b/swaggerci/storage/generated/runtime/DictionaryExtensions.cs @@ -0,0 +1,33 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + internal static class DictionaryExtensions + { + internal static void HashTableToDictionary(System.Collections.Hashtable hashtable, System.Collections.Generic.IDictionary dictionary) + { + if (null == hashtable) + { + return; + } + foreach (var each in hashtable.Keys) + { + var key = each.ToString(); + var value = hashtable[key]; + if (null != value) + { + try + { + dictionary[key] = (V)value; + } + catch + { + // Values getting dropped; not compatible with target dictionary. Not sure what to do here. + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/EventData.cs b/swaggerci/storage/generated/runtime/EventData.cs new file mode 100644 index 000000000000..873324f39162 --- /dev/null +++ b/swaggerci/storage/generated/runtime/EventData.cs @@ -0,0 +1,78 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + + using System; + using System.Threading; + + ///Represents the data in signaled event. + public partial class EventData + { + /// + /// The type of the event being signaled + /// + public string Id; + + /// + /// The user-ready message from the event. + /// + public string Message; + + /// + /// When the event is about a parameter, this is the parameter name. + /// Used in Validation Events + /// + public string Parameter; + + /// + /// This represents a numeric value associated with the event. + /// Use for progress-style events + /// + public double Value; + + /// + /// Any extended data for an event should be serialized and stored here. + /// + public string ExtendedData; + + /// + /// If the event triggers after the request message has been created, this will contain the Request Message (which in HTTP calls would be HttpRequestMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.RequestMessgae is HttpRequestMessage httpRequest) + /// { + /// httpRequest.Headers.Add("x-request-flavor", "vanilla"); + /// } + /// + /// + public object RequestMessage; + + /// + /// If the event triggers after the response is back, this will contain the Response Message (which in HTTP calls would be HttpResponseMessage) + /// + /// Typically you'd cast this to the expected type to use it: + /// + /// if(eventData.ResponseMessage is HttpResponseMessage httpResponse){ + /// var flavor = httpResponse.Headers.GetValue("x-request-flavor"); + /// } + /// + /// + public object ResponseMessage; + + /// + /// Cancellation method for this event. + /// + /// If the event consumer wishes to cancel the request that initiated this event, call Cancel() + /// + /// + /// The original initiator of the request must provide the implementation of this. + /// + public System.Action Cancel; + } + +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/EventDataExtensions.cs b/swaggerci/storage/generated/runtime/EventDataExtensions.cs new file mode 100644 index 000000000000..3a07dc0b5d42 --- /dev/null +++ b/swaggerci/storage/generated/runtime/EventDataExtensions.cs @@ -0,0 +1,94 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System; + + /// + /// PowerShell-specific data on top of the llc# EventData + /// + /// + /// In PowerShell, we add on the EventDataConverter to support sending events between modules. + /// Obviously, this code would need to be duplcated on both modules. + /// This is preferable to sharing a common library, as versioning makes that problematic. + /// + [System.ComponentModel.TypeConverter(typeof(EventDataConverter))] + public partial class EventData : EventArgs + { + } + + /// + /// A PowerShell PSTypeConverter to adapt an EventData object that has been passed. + /// Usually used between modules. + /// + public class EventDataConverter : System.Management.Automation.PSTypeConverter + { + public override bool CanConvertTo(object sourceValue, Type destinationType) => false; + public override object ConvertTo(object sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => null; + public override bool CanConvertFrom(dynamic sourceValue, Type destinationType) => destinationType == typeof(EventData) && CanConvertFrom(sourceValue); + public override object ConvertFrom(dynamic sourceValue, Type destinationType, IFormatProvider formatProvider, bool ignoreCase) => ConvertFrom(sourceValue); + + /// + /// Verifies that a given object has the required members to convert it to the target type (EventData) + /// + /// Uses a dynamic type so that it is able to use the simplest code without excessive checking. + /// + /// The instance to verify + /// True, if the object has all the required parameters. + public static bool CanConvertFrom(dynamic sourceValue) + { + try + { + // check if this has *required* parameters... + sourceValue?.Id?.GetType(); + sourceValue?.Message?.GetType(); + sourceValue?.Cancel?.GetType(); + + // remaining parameters are not *required*, + // and if they have values, it will copy them at conversion time. + } + catch + { + // if anything throws an exception (because it's null, or doesn't have that member) + return false; + } + return true; + } + + /// + /// Returns result of the delegate as the expected type, or default(T) + /// + /// This isolates any exceptions from the consumer. + /// + /// A delegate that returns a value + /// The desired output type + /// The value from the function if the type is correct + private static T To(Func srcValue) + { + try { return srcValue(); } + catch { return default(T); } + } + + /// + /// Converts an incoming object to the expected type by treating the incoming object as a dynamic, and coping the expected values. + /// + /// the incoming object + /// EventData + public static EventData ConvertFrom(dynamic sourceValue) + { + return new EventData + { + Id = To(() => sourceValue.Id), + Message = To(() => sourceValue.Message), + Parameter = To(() => sourceValue.Parameter), + Value = To(() => sourceValue.Value), + RequestMessage = To(() => sourceValue.RequestMessage), + ResponseMessage = To(() => sourceValue.ResponseMessage), + Cancel = To(() => sourceValue.Cancel) + }; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/EventListener.cs b/swaggerci/storage/generated/runtime/EventListener.cs new file mode 100644 index 000000000000..677f19349734 --- /dev/null +++ b/swaggerci/storage/generated/runtime/EventListener.cs @@ -0,0 +1,247 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + + using System; + using System.Linq; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData = System.Func; + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public interface IValidates + { + Task Validate(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IEventListener listener); + } + + /// + /// The IEventListener Interface defines the communication mechanism for Signaling events during a remote call. + /// + /// + /// The interface is designed to be as minimal as possible, allow for quick peeking of the event type (id) + /// and the cancellation status and provides a delegate for retrieving the event details themselves. + /// + public interface IEventListener + { + Task Signal(string id, CancellationToken token, GetEventData createMessage); + CancellationToken Token { get; } + System.Action Cancel { get; } + } + + internal static partial class Extensions + { + public static Task Signal(this IEventListener instance, string id, CancellationToken token, Func createMessage) => instance.Signal(id, token, createMessage); + public static Task Signal(this IEventListener instance, string id, CancellationToken token) => instance.Signal(id, token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, HttpResponseMessage response) => instance.Signal(id, token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, CancellationToken token, EventData message) => instance.Signal(id, token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, Func createMessage) => instance.Signal(id, instance.Token, createMessage); + public static Task Signal(this IEventListener instance, string id) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = request, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, string messageText, double magnitude, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = messageText, RequestMessage = response.RequestMessage, ResponseMessage = response, Value = magnitude, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpRequestMessage request, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = request, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, HttpResponseMessage response) => instance.Signal(id, instance.Token, () => new EventData { Id = id, RequestMessage = response.RequestMessage, ResponseMessage = response, Cancel = instance.Cancel }); + public static Task Signal(this IEventListener instance, string id, EventData message) => instance.Signal(id, instance.Token, () => { message.Id = id; message.Cancel = instance.Cancel; return message; }); + + public static Task Signal(this IEventListener instance, string id, System.Uri uri) => instance.Signal(id, instance.Token, () => new EventData { Id = id, Message = uri.ToString(), Cancel = instance.Cancel }); + + public static async Task AssertNotNull(this IEventListener instance, string parameterName, object value) + { + if (value == null) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' should not be null", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMinimumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length < length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is less than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertMaximumLength(this IEventListener instance, string parameterName, string value, int length) + { + if (value != null && value.Length > length) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Length of '{parameterName}' is greater than {length}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + + public static async Task AssertRegEx(this IEventListener instance, string parameterName, string value, string regularExpression) + { + if (value != null && !System.Text.RegularExpressions.Regex.Match(value, regularExpression).Success) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' does not validate against pattern /{regularExpression}/", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertEnum(this IEventListener instance, string parameterName, string value, params string[] values) + { + if (!values.Any(each => each.Equals(value))) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"'{parameterName}' is not one of ({values.Aggregate((c, e) => $"'{e}',{c}")}", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertObjectIsValid(this IEventListener instance, string parameterName, object inst) + { + await (inst as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.IValidates)?.Validate(instance); + } + + public static async Task AssertIsLessThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) >= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThan(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) <= 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsLessThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) > 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be less than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsGreaterThanOrEqual(this IEventListener instance, string parameterName, T? value, T max) where T : struct, System.IComparable + { + if (null != value && ((T)value).CompareTo(max) < 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be greater than or equal to {max} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, Int64? value, Int64 multiple) + { + if (null != value && value % multiple != 0) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, double? value, double multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + public static async Task AssertIsMultipleOf(this IEventListener instance, string parameterName, decimal? value, decimal multiple) + { + if (null != value) + { + var i = (Int64)(value / multiple); + if (i != value / multiple) + { + await instance.Signal(Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, instance.Token, () => new EventData { Id = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Events.ValidationWarning, Message = $"Value of '{parameterName}' must be multiple of {multiple} (value is {value})", Parameter = parameterName, Cancel = instance.Cancel }); + } + } + } + } + + /// + /// An Implementation of the IEventListener that supports subscribing to events and dispatching them + /// (used for manually using the lowlevel interface) + /// + public class EventListener : CancellationTokenSource, IEnumerable>, IEventListener + { + private Dictionary calls = new Dictionary(); + public IEnumerator> GetEnumerator() => calls.GetEnumerator(); + IEnumerator IEnumerable.GetEnumerator() => calls.GetEnumerator(); + public EventListener() + { + } + + public new Action Cancel => base.Cancel; + private Event tracer; + + public EventListener(params (string name, Event callback)[] initializer) + { + foreach (var each in initializer) + { + Add(each.name, each.callback); + } + } + + public void Add(string name, SynchEvent callback) + { + Add(name, (message) => { callback(message); return Task.CompletedTask; }); + } + + public void Add(string name, Event callback) + { + if (callback != null) + { + if (string.IsNullOrEmpty(name)) + { + if (calls.ContainsKey(name)) + { + tracer += callback; + } + else + { + tracer = callback; + } + } + else + { + if (calls.ContainsKey(name)) + { + calls[name ?? System.String.Empty] += callback; + } + else + { + calls[name ?? System.String.Empty] = callback; + } + } + } + } + + + public async Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + using (NoSynchronizationContext) + { + if (!string.IsNullOrEmpty(id) && (calls.TryGetValue(id, out Event listener) || tracer != null)) + { + var message = createMessage(); + message.Id = id; + + await listener?.Invoke(message); + await tracer?.Invoke(message); + + if (token.IsCancellationRequested) + { + throw new OperationCanceledException($"Canceled by event {id} ", this.Token); + } + } + } + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Events.cs b/swaggerci/storage/generated/runtime/Events.cs new file mode 100644 index 000000000000..5b5f3f083fe8 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Events.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + public static partial class Events + { + public const string Log = nameof(Log); + public const string Validation = nameof(Validation); + public const string ValidationWarning = nameof(ValidationWarning); + public const string AfterValidation = nameof(AfterValidation); + public const string RequestCreated = nameof(RequestCreated); + public const string ResponseCreated = nameof(ResponseCreated); + public const string URLCreated = nameof(URLCreated); + public const string Finally = nameof(Finally); + public const string HeaderParametersAdded = nameof(HeaderParametersAdded); + public const string BodyContentSet = nameof(BodyContentSet); + public const string BeforeCall = nameof(BeforeCall); + public const string BeforeResponseDispatch = nameof(BeforeResponseDispatch); + public const string FollowingNextLink = nameof(FollowingNextLink); + public const string DelayBeforePolling = nameof(DelayBeforePolling); + public const string Polling = nameof(Polling); + + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/EventsExtensions.cs b/swaggerci/storage/generated/runtime/EventsExtensions.cs new file mode 100644 index 000000000000..b32b2c97f75c --- /dev/null +++ b/swaggerci/storage/generated/runtime/EventsExtensions.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + public static partial class Events + { + public const string CmdletProcessRecordStart = nameof(CmdletProcessRecordStart); + public const string CmdletProcessRecordAsyncStart = nameof(CmdletProcessRecordAsyncStart); + public const string CmdletException = nameof(CmdletException); + public const string CmdletGetPipeline = nameof(CmdletGetPipeline); + public const string CmdletBeforeAPICall = nameof(CmdletBeforeAPICall); + public const string CmdletBeginProcessing = nameof(CmdletBeginProcessing); + public const string CmdletEndProcessing = nameof(CmdletEndProcessing); + public const string CmdletProcessRecordEnd = nameof(CmdletProcessRecordEnd); + public const string CmdletProcessRecordAsyncEnd = nameof(CmdletProcessRecordAsyncEnd); + public const string CmdletAfterAPICall = nameof(CmdletAfterAPICall); + + public const string Verbose = nameof(Verbose); + public const string Debug = nameof(Debug); + public const string Information = nameof(Information); + public const string Error = nameof(Error); + public const string Warning = nameof(Warning); + } + +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Extensions.cs b/swaggerci/storage/generated/runtime/Extensions.cs new file mode 100644 index 000000000000..441644a826cb --- /dev/null +++ b/swaggerci/storage/generated/runtime/Extensions.cs @@ -0,0 +1,117 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System.Linq; + using System; + + internal static partial class Extensions + { + public static T[] SubArray(this T[] array, int offset, int length) + { + return new ArraySegment(array, offset, length) + .ToArray(); + } + + public static T ReadHeaders(this T instance, global::System.Net.Http.Headers.HttpResponseHeaders headers) where T : class + { + (instance as IHeaderSerializable)?.ReadHeaders(headers); + return instance; + } + + internal static bool If(T input, out T output) + { + if (null == input) + { + output = default(T); + return false; + } + output = input; + return true; + } + + internal static void AddIf(T value, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(value); + } + } + + internal static void AddIf(T value, string serializedName, System.Action addMethod) + { + // if value is present (and it's not just an empty JSON Object) + if (null != value && (value as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject)?.Keys.Count != 0) + { + addMethod(serializedName, value); + } + } + + /// + /// Returns the first header value as a string from an HttpReponseMessage. + /// + /// the HttpResponseMessage to fetch a header from + /// the header name + /// the first header value as a string from an HttpReponseMessage. string.empty if there is no header value matching + internal static string GetFirstHeader(this System.Net.Http.HttpResponseMessage response, string headerName) => response.Headers.FirstOrDefault(each => string.Equals(headerName, each.Key, System.StringComparison.OrdinalIgnoreCase)).Value?.FirstOrDefault() ?? string.Empty; + + /// + /// Sets the Synchronization Context to null, and returns an IDisposable that when disposed, + /// will restore the synchonization context to the original value. + /// + /// This is used a less-invasive means to ensure that code in the library that doesn't + /// need to be continued in the original context doesn't have to have ConfigureAwait(false) + /// on every single await + /// + /// If the SynchronizationContext is null when this is used, the resulting IDisposable + /// will not do anything (this prevents excessive re-setting of the SynchronizationContext) + /// + /// Usage: + /// + /// using(NoSynchronizationContext) { + /// await SomeAsyncOperation(); + /// await SomeOtherOperation(); + /// } + /// + /// + /// + /// An IDisposable that will return the SynchronizationContext to original state + internal static System.IDisposable NoSynchronizationContext => System.Threading.SynchronizationContext.Current == null ? Dummy : new NoSyncContext(); + + /// + /// An instance of the Dummy IDispoable. + /// + /// + internal static System.IDisposable Dummy = new DummyDisposable(); + + /// + /// An IDisposable that does absolutely nothing. + /// + internal class DummyDisposable : System.IDisposable + { + public void Dispose() + { + } + } + /// + /// An IDisposable that saves the SynchronizationContext,sets it to null and + /// restores it to the original upon Dispose(). + /// + /// NOTE: This is designed to be less invasive than using .ConfigureAwait(false) + /// on every single await in library code (ie, places where we know we don't need + /// to continue in the same context as we went async) + /// + internal class NoSyncContext : System.IDisposable + { + private System.Threading.SynchronizationContext original = System.Threading.SynchronizationContext.Current; + internal NoSyncContext() + { + System.Threading.SynchronizationContext.SetSynchronizationContext(null); + } + public void Dispose() => System.Threading.SynchronizationContext.SetSynchronizationContext(original); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs b/swaggerci/storage/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs new file mode 100644 index 000000000000..1ecf8a11674b --- /dev/null +++ b/swaggerci/storage/generated/runtime/Helpers/Extensions/StringBuilderExtensions.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal static class StringBuilderExtensions + { + /// + /// Extracts the buffered value and resets the buffer + /// + internal static string Extract(this StringBuilder builder) + { + var text = builder.ToString(); + + builder.Clear(); + + return text; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Helpers/Extensions/TypeExtensions.cs b/swaggerci/storage/generated/runtime/Helpers/Extensions/TypeExtensions.cs new file mode 100644 index 000000000000..eefab199f5f2 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Helpers/Extensions/TypeExtensions.cs @@ -0,0 +1,61 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal static class TypeExtensions + { + internal static bool IsNullable(this Type type) => + type.IsGenericType && type.GetGenericTypeDefinition().Equals(typeof(Nullable<>)); + + internal static Type GetOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition() == openGenericInterfaceType) + { + return candidateType; + } + + // Check if it references it's own converter.... + + foreach (Type interfaceType in candidateType.GetInterfaces()) + { + if (interfaceType.IsGenericType + && interfaceType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return interfaceType; + } + } + + return null; + } + + // Author: Sebastian Good + // http://stackoverflow.com/questions/503263/how-to-determine-if-a-type-implements-a-specific-generic-interface-type + internal static bool ImplementsOpenGenericInterface(this Type candidateType, Type openGenericInterfaceType) + { + if (candidateType.Equals(openGenericInterfaceType)) + { + return true; + } + + if (candidateType.IsGenericType && candidateType.GetGenericTypeDefinition().Equals(openGenericInterfaceType)) + { + return true; + } + + foreach (Type i in candidateType.GetInterfaces()) + { + if (i.IsGenericType && i.ImplementsOpenGenericInterface(openGenericInterfaceType)) + { + return true; + } + } + + return false; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Helpers/Seperator.cs b/swaggerci/storage/generated/runtime/Helpers/Seperator.cs new file mode 100644 index 000000000000..4372715758e3 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Helpers/Seperator.cs @@ -0,0 +1,11 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal static class Seperator + { + internal static readonly char[] Dash = { '-' }; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Helpers/TypeDetails.cs b/swaggerci/storage/generated/runtime/Helpers/TypeDetails.cs new file mode 100644 index 000000000000..f7883dcc5067 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Helpers/TypeDetails.cs @@ -0,0 +1,116 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + + + + internal class TypeDetails + { + private readonly Type info; + + internal TypeDetails(Type info) + { + this.info = info ?? throw new ArgumentNullException(nameof(info)); + } + + internal Type NonNullType { get; set; } + + internal object DefaultValue { get; set; } + + internal bool IsNullable { get; set; } + + internal bool IsList { get; set; } + + internal bool IsStringLike { get; set; } + + internal bool IsEnum => info.IsEnum; + + internal bool IsArray => info.IsArray; + + internal bool IsValueType => info.IsValueType; + + internal Type ElementType { get; set; } + + internal IJsonConverter JsonConverter { get; set; } + + #region Creation + + private static readonly ConcurrentDictionary cache = new ConcurrentDictionary(); + + internal static TypeDetails Get() => Get(typeof(T)); + + internal static TypeDetails Get(Type type) => cache.GetOrAdd(type, Create); + + private static TypeDetails Create(Type type) + { + var isGenericList = !type.IsPrimitive && type.ImplementsOpenGenericInterface(typeof(IList<>)); + var isList = !type.IsPrimitive && (isGenericList || typeof(IList).IsAssignableFrom(type)); + + var isNullable = type.IsNullable(); + + Type elementType; + + if (type.IsArray) + { + elementType = type.GetElementType(); + } + else if (isGenericList) + { + var iList = type.GetOpenGenericInterface(typeof(IList<>)); + + elementType = iList.GetGenericArguments()[0]; + } + else + { + elementType = null; + } + + var nonNullType = isNullable ? type.GetGenericArguments()[0] : type; + + var isStringLike = false; + + IJsonConverter converter; + + var jsonConverterAttribute = type.GetCustomAttribute(); + + if (jsonConverterAttribute != null) + { + converter = jsonConverterAttribute.Converter; + } + else if (nonNullType.IsEnum) + { + converter = new EnumConverter(nonNullType); + } + else if (JsonConverterFactory.Instances.TryGetValue(nonNullType, out converter)) + { + } + else if (StringLikeHelper.IsStringLike(nonNullType)) + { + isStringLike = true; + + converter = new StringLikeConverter(nonNullType); + } + + return new TypeDetails(nonNullType) { + NonNullType = nonNullType, + DefaultValue = type.IsValueType ? Activator.CreateInstance(type) : null, + IsNullable = isNullable, + IsList = isList, + IsStringLike = isStringLike, + ElementType = elementType, + JsonConverter = converter + }; + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Helpers/XHelper.cs b/swaggerci/storage/generated/runtime/Helpers/XHelper.cs new file mode 100644 index 000000000000..bb22a090b5d9 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Helpers/XHelper.cs @@ -0,0 +1,75 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal static class XHelper + { + internal static JsonNode Create(JsonType type, TypeCode code, object value) + { + switch (type) + { + case JsonType.Binary : return new XBinary((byte[])value); + case JsonType.Boolean : return new JsonBoolean((bool)value); + case JsonType.Number : return new JsonNumber(value.ToString()); + case JsonType.String : return new JsonString((string)value); + } + + throw new Exception($"JsonType '{type}' does not have a fast conversion"); + } + + internal static bool TryGetElementType(TypeCode code, out JsonType type) + { + switch (code) + { + case TypeCode.Boolean : type = JsonType.Boolean; return true; + case TypeCode.Byte : type = JsonType.Number; return true; + case TypeCode.DateTime : type = JsonType.Date; return true; + case TypeCode.Decimal : type = JsonType.Number; return true; + case TypeCode.Double : type = JsonType.Number; return true; + case TypeCode.Empty : type = JsonType.Null; return true; + case TypeCode.Int16 : type = JsonType.Number; return true; + case TypeCode.Int32 : type = JsonType.Number; return true; + case TypeCode.Int64 : type = JsonType.Number; return true; + case TypeCode.SByte : type = JsonType.Number; return true; + case TypeCode.Single : type = JsonType.Number; return true; + case TypeCode.String : type = JsonType.String; return true; + case TypeCode.UInt16 : type = JsonType.Number; return true; + case TypeCode.UInt32 : type = JsonType.Number; return true; + case TypeCode.UInt64 : type = JsonType.Number; return true; + } + + type = default; + + return false; + } + + internal static JsonType GetElementType(TypeCode code) + { + switch (code) + { + case TypeCode.Boolean : return JsonType.Boolean; + case TypeCode.Byte : return JsonType.Number; + case TypeCode.DateTime : return JsonType.Date; + case TypeCode.Decimal : return JsonType.Number; + case TypeCode.Double : return JsonType.Number; + case TypeCode.Empty : return JsonType.Null; + case TypeCode.Int16 : return JsonType.Number; + case TypeCode.Int32 : return JsonType.Number; + case TypeCode.Int64 : return JsonType.Number; + case TypeCode.SByte : return JsonType.Number; + case TypeCode.Single : return JsonType.Number; + case TypeCode.String : return JsonType.String; + case TypeCode.UInt16 : return JsonType.Number; + case TypeCode.UInt32 : return JsonType.Number; + case TypeCode.UInt64 : return JsonType.Number; + default : return JsonType.Object; + } + + throw new Exception($"TypeCode '{code}' does not have a fast converter"); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/HttpPipeline.cs b/swaggerci/storage/generated/runtime/HttpPipeline.cs new file mode 100644 index 000000000000..152fb4aa5fc5 --- /dev/null +++ b/swaggerci/storage/generated/runtime/HttpPipeline.cs @@ -0,0 +1,88 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + using GetEventData = System.Func; + using NextDelegate = System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + + using SignalDelegate = System.Func, System.Threading.Tasks.Task>; + using GetParameterDelegate = System.Func, string, object>; + using SendAsyncStepDelegate = System.Func, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>; + using PipelineChangeDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>; + using ModuleLoadPipelineDelegate = System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + using NewRequestPipelineDelegate = System.Action, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>, System.Action, System.Threading.Tasks.Task>, System.Func, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>, System.Threading.Tasks.Task>>>; + +/* + public class DelegateBasedEventListener : IEventListener + { + private EventListenerDelegate _listener; + public DelegateBasedEventListener(EventListenerDelegate listener) + { + _listener = listener; + } + public CancellationToken Token => CancellationToken.None; + public System.Action Cancel => () => { }; + + + public Task Signal(string id, CancellationToken token, GetEventData createMessage) + { + return _listener(id, token, () => createMessage()); + } + } +*/ + /// + /// This is a necessary extension to the SendAsyncFactory to support the 'generic' delegate format. + /// + public partial class SendAsyncFactory + { + /// + /// This translates a generic-defined delegate for a listener into one that fits our ISendAsync pattern. + /// (Provided to support out-of-module delegation for Azure Cmdlets) + /// + /// The Pipeline Step as a delegate + public SendAsyncFactory(SendAsyncStepDelegate step) => this.implementation = (request, listener, next) => + step( + request, + listener.Token, + listener.Cancel, + (id, token, getEventData) => listener.Signal(id, token, () => { + var data = EventDataConverter.ConvertFrom( getEventData() ) as EventData; + data.Id = id; + data.Cancel = listener.Cancel; + data.RequestMessage = request; + return data; + }), + (req, token, cancel, listenerDelegate) => next.SendAsync(req, listener)); + } + + public partial class HttpPipeline : ISendAsync + { + public HttpPipeline Append(SendAsyncStepDelegate item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStepDelegate item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + } +} diff --git a/swaggerci/storage/generated/runtime/HttpPipelineMocking.ps1 b/swaggerci/storage/generated/runtime/HttpPipelineMocking.ps1 new file mode 100644 index 000000000000..8b2e7b6daa13 --- /dev/null +++ b/swaggerci/storage/generated/runtime/HttpPipelineMocking.ps1 @@ -0,0 +1,110 @@ +$ErrorActionPreference = "Stop" + +# get the recording path +if (-not $TestRecordingFile) { + $TestRecordingFile = Join-Path $PSScriptRoot 'recording.json' +} + +# create the Http Pipeline Recorder +$Mock = New-Object -Type Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PipelineMock $TestRecordingFile + +# set the recorder to the appropriate mode (default to 'live') +Write-Host -ForegroundColor Green "Running '$TestMode' mode..." +switch ($TestMode) { + 'record' { + Write-Host -ForegroundColor Green "Recording to $TestRecordingFile" + $Mock.SetRecord() + $null = erase -ea 0 $TestRecordingFile + } + 'playback' { + if (-not (Test-Path $TestRecordingFile)) { + Write-Host -fore:yellow "Recording file '$TestRecordingFile' is not present. Tests expecting recorded responses will fail" + } else { + Write-Host -ForegroundColor Green "Using recording $TestRecordingFile" + } + $Mock.SetPlayback() + $Mock.ForceResponseHeaders["Retry-After"] = "0"; + } + default: { + $Mock.SetLive() + } +} + +# overrides for Pester Describe/Context/It + +function Describe( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushDescription($Name) + try { + return pester\Describe -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopDescription() + } +} + +function Context( + [Parameter(Mandatory = $true, Position = 0)] + [string] $Name, + + [Alias('Tags')] + [string[]] $Tag = @(), + + [Parameter(Position = 1)] + [ValidateNotNull()] + [ScriptBlock] $Fixture = $(Throw "No test script block is provided. (Have you put the open curly brace on the next line?)") +) { + $Mock.PushContext($Name) + try { + return pester\Context -Name $Name -Tag $Tag -Fixture $fixture + } + finally { + $Mock.PopContext() + } +} + +function It { + [CmdletBinding(DefaultParameterSetName = 'Normal')] + param( + [Parameter(Mandatory = $true, Position = 0)] + [string]$Name, + + [Parameter(Position = 1)] + [ScriptBlock] $Test = { }, + + [System.Collections.IDictionary[]] $TestCases, + + [Parameter(ParameterSetName = 'Pending')] + [Switch] $Pending, + + [Parameter(ParameterSetName = 'Skip')] + [Alias('Ignore')] + [Switch] $Skip + ) + $Mock.PushScenario($Name) + + try { + if ($skip) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Skip + } + if ($pending) { + return pester\It -Name $Name -Test $Test -TestCases $TestCases -Pending + } + return pester\It -Name $Name -Test $Test -TestCases $TestCases + } + finally { + $null = $Mock.PopScenario() + } +} + +# set the HttpPipelineAppend for all the cmdlets +$PSDefaultParameterValues["*:HttpPipelinePrepend"] = $Mock diff --git a/swaggerci/storage/generated/runtime/IAssociativeArray.cs b/swaggerci/storage/generated/runtime/IAssociativeArray.cs new file mode 100644 index 000000000000..a0cb7beb21e4 --- /dev/null +++ b/swaggerci/storage/generated/runtime/IAssociativeArray.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +#define DICT_PROPERTIES +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + /// A subset of IDictionary that doesn't implement IEnumerable or IDictionary to work around PowerShell's aggressive formatter + public interface IAssociativeArray + { +#if DICT_PROPERTIES + System.Collections.Generic.IEnumerable Keys { get; } + System.Collections.Generic.IEnumerable Values { get; } + int Count { get; } +#endif + System.Collections.Generic.IDictionary AdditionalProperties { get; } + T this[string index] { get; set; } + void Add(string key, T value); + bool ContainsKey(string key); + bool Remove(string key); + bool TryGetValue(string key, out T value); + void Clear(); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/IHeaderSerializable.cs b/swaggerci/storage/generated/runtime/IHeaderSerializable.cs new file mode 100644 index 000000000000..5511c5d04b5a --- /dev/null +++ b/swaggerci/storage/generated/runtime/IHeaderSerializable.cs @@ -0,0 +1,14 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + public interface IHeaderSerializable + { + void ReadHeaders(global::System.Net.Http.Headers.HttpResponseHeaders headers); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/ISendAsync.cs b/swaggerci/storage/generated/runtime/ISendAsync.cs new file mode 100644 index 000000000000..b982fb5c3386 --- /dev/null +++ b/swaggerci/storage/generated/runtime/ISendAsync.cs @@ -0,0 +1,300 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System.Net.Http; + using System.Collections.Generic; + using System.Threading; + using System.Threading.Tasks; + using System.Collections; + using System.Linq; + + /// + /// The interface for sending an HTTP request across the wire. + /// + public interface ISendAsync + { + Task SendAsync(HttpRequestMessage request, IEventListener callback); + } + + public class SendAsyncTerminalFactory : ISendAsyncTerminalFactory, ISendAsync + { + SendAsync implementation; + + public SendAsyncTerminalFactory(SendAsync implementation) => this.implementation = implementation; + public SendAsyncTerminalFactory(ISendAsync implementation) => this.implementation = implementation.SendAsync; + public ISendAsync Create() => this; + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback); + } + + public partial class SendAsyncFactory : ISendAsyncFactory + { + public class Sender : ISendAsync + { + internal ISendAsync next; + internal SendAsyncStep implementation; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => implementation(request, callback, next); + } + SendAsyncStep implementation; + + public SendAsyncFactory(SendAsyncStep implementation) => this.implementation = implementation; + public ISendAsync Create(ISendAsync next) => new Sender { next = next, implementation = implementation }; + + } + + public class HttpClientFactory : ISendAsyncTerminalFactory, ISendAsync + { + HttpClient client; + public HttpClientFactory() : this(new HttpClient()) + { + } + public HttpClientFactory(HttpClient client) => this.client = client; + public ISendAsync Create() => this; + + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => client.SendAsync(request, HttpCompletionOption.ResponseHeadersRead, callback.Token); + } + + public interface ISendAsyncFactory + { + ISendAsync Create(ISendAsync next); + } + + public interface ISendAsyncTerminalFactory + { + ISendAsync Create(); + } + + public partial class HttpPipeline : ISendAsync + { + private ISendAsync pipeline; + private ISendAsyncTerminalFactory terminal; + private List steps = new List(); + + public HttpPipeline() : this(new HttpClientFactory()) + { + } + + public HttpPipeline(ISendAsyncTerminalFactory terminalStep) + { + if (terminalStep == null) + { + throw new System.ArgumentNullException(nameof(terminalStep), "Terminal Step Factory in HttpPipeline may not be null"); + } + TerminalFactory = terminalStep; + } + + /// + /// Returns an HttpPipeline with the current state of this pipeline. + /// + public HttpPipeline Clone() => new HttpPipeline(terminal) { steps = this.steps.ToList(), pipeline = this.pipeline }; + + public ISendAsyncTerminalFactory TerminalFactory + { + get => terminal; + set + { + if (value == null) + { + throw new System.ArgumentNullException("TerminalFactory in HttpPipeline may not be null"); + } + terminal = value; + } + } + + public ISendAsync Pipeline + { + get + { + // if the pipeline has been created and not invalidated, return it. + if (this.pipeline != null) + { + return this.pipeline; + } + + // create the pipeline from scratch. + var next = terminal.Create(); + foreach (var factory in steps) + { + // skip factories that return null. + next = factory.Create(next) ?? next; + } + return this.pipeline = next; + } + } + + public int Count => steps.Count; + + public HttpPipeline Prepend(ISendAsyncFactory item) + { + if (item != null) + { + steps.Add(item); + pipeline = null; + } + return this; + } + + public HttpPipeline Append(SendAsyncStep item) + { + if (item != null) + { + Append(new SendAsyncFactory(item)); + } + return this; + } + + public HttpPipeline Prepend(SendAsyncStep item) + { + if (item != null) + { + Prepend(new SendAsyncFactory(item)); + } + return this; + } + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(new SendAsyncFactory(item)); + } + } + return this; + } + + public HttpPipeline Append(ISendAsyncFactory item) + { + if (item != null) + { + steps.Insert(0, item); + pipeline = null; + } + return this; + } + public HttpPipeline Prepend(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Prepend(item); + } + } + return this; + } + + public HttpPipeline Append(IEnumerable items) + { + if (items != null) + { + foreach (var item in items) + { + Append(item); + } + } + return this; + } + + // you can use this as the ISendAsync Implementation + public Task SendAsync(HttpRequestMessage request, IEventListener callback) => Pipeline.SendAsync(request, callback); + } + + internal static partial class Extensions + { + internal static HttpRequestMessage CloneAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.Clone(requestUri, method); + } + } + + internal static Task CloneWithContentAndDispose(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + using (original) + { + return original.CloneWithContent(requestUri, method); + } + } + + /// + /// Clones an HttpRequestMessage (without the content) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static HttpRequestMessage Clone(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = new HttpRequestMessage + { + Method = method ?? original.Method, + RequestUri = requestUri ?? original.RequestUri, + Version = original.Version, + }; + + foreach (KeyValuePair prop in original.Properties) + { + clone.Properties.Add(prop); + } + + foreach (KeyValuePair> header in original.Headers) + { + /* + **temporarily skip cloning telemetry related headers** + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + */ + if (!"x-ms-unique-id".Equals(header.Key) && !"x-ms-client-request-id".Equals(header.Key) && !"CommandName".Equals(header.Key) && !"FullCommandName".Equals(header.Key) && !"ParameterSetName".Equals(header.Key) && !"User-Agent".Equals(header.Key)) + { + clone.Headers.TryAddWithoutValidation(header.Key, header.Value); + } + } + + return clone; + } + + /// + /// Clones an HttpRequestMessage (including the content stream and content headers) + /// + /// Original HttpRequestMessage (Will be diposed before returning) + /// + /// + /// A clone of the HttpRequestMessage + internal static async Task CloneWithContent(this HttpRequestMessage original, System.Uri requestUri = null, System.Net.Http.HttpMethod method = null) + { + var clone = original.Clone(requestUri, method); + var stream = new System.IO.MemoryStream(); + if (original.Content != null) + { + await original.Content.CopyToAsync(stream).ConfigureAwait(false); + stream.Position = 0; + clone.Content = new StreamContent(stream); + if (original.Content.Headers != null) + { + foreach (var h in original.Content.Headers) + { + clone.Content.Headers.Add(h.Key, h.Value); + } + } + } + return clone; + } + } +} diff --git a/swaggerci/storage/generated/runtime/InfoAttribute.cs b/swaggerci/storage/generated/runtime/InfoAttribute.cs new file mode 100644 index 000000000000..ad6bafc086bb --- /dev/null +++ b/swaggerci/storage/generated/runtime/InfoAttribute.cs @@ -0,0 +1,34 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System; + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Class)] + public class InfoAttribute : Attribute + { + public bool Required { get; set; } = false; + public bool ReadOnly { get; set; } = false; + public Type[] PossibleTypes { get; set; } = new Type[0]; + public string Description { get; set; } = ""; + public string SerializedName { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class CompleterInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class DefaultInfoAttribute : Attribute + { + public string Script { get; set; } = ""; + public string Name { get; set; } = ""; + public string Description { get; set; } = ""; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Iso/IsoDate.cs b/swaggerci/storage/generated/runtime/Iso/IsoDate.cs new file mode 100644 index 000000000000..c83bb04b16ac --- /dev/null +++ b/swaggerci/storage/generated/runtime/Iso/IsoDate.cs @@ -0,0 +1,214 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal struct IsoDate + { + internal int Year { get; set; } // 0-3000 + + internal int Month { get; set; } // 1-12 + + internal int Day { get; set; } // 1-31 + + internal int Hour { get; set; } // 0-24 + + internal int Minute { get; set; } // 0-60 (60 is a special case) + + internal int Second { get; set; } // 0-60 (60 is used for leap seconds) + + internal double Millisecond { get; set; } // 0-999.9... + + internal TimeSpan Offset { get; set; } + + internal DateTimeKind Kind { get; set; } + + internal TimeSpan TimeOfDay => new TimeSpan(Hour, Minute, Second); + + internal DateTime ToDateTime() + { + if (Kind == DateTimeKind.Utc || Offset == TimeSpan.Zero) + { + return new DateTime(Year, Month, Day, Hour, Minute, Second, (int)Millisecond, DateTimeKind.Utc); + } + + return ToDateTimeOffset().DateTime; + } + + internal DateTimeOffset ToDateTimeOffset() + { + return new DateTimeOffset( + Year, + Month, + Day, + Hour, + Minute, + Second, + (int)Millisecond, + Offset + ); + } + + internal DateTime ToUtcDateTime() + { + return ToDateTimeOffset().UtcDateTime; + } + + public override string ToString() + { + var sb = new StringBuilder(); + + // yyyy-MM-dd + sb.Append($"{Year}-{Month:00}-{Day:00}"); + + if (TimeOfDay > new TimeSpan(0)) + { + sb.Append($"T{Hour:00}:{Minute:00}"); + + if (TimeOfDay.Seconds > 0) + { + sb.Append($":{Second:00}"); + } + } + + if (Offset.Ticks == 0) + { + sb.Append('Z'); // UTC + } + else + { + if (Offset.Ticks >= 0) + { + sb.Append('+'); + } + + sb.Append($"{Offset.Hours:00}:{Offset.Minutes:00}"); + } + + return sb.ToString(); + } + + internal static IsoDate FromDateTimeOffset(DateTimeOffset date) + { + return new IsoDate { + Year = date.Year, + Month = date.Month, + Day = date.Day, + Hour = date.Hour, + Minute = date.Minute, + Second = date.Second, + Offset = date.Offset, + Kind = date.Offset == TimeSpan.Zero ? DateTimeKind.Utc : DateTimeKind.Unspecified + }; + } + + private static readonly char[] timeSeperators = { ':', '.' }; + + internal static IsoDate Parse(string text) + { + var tzIndex = -1; + var timeIndex = text.IndexOf('T'); + + var builder = new IsoDate { Day = 1, Month = 1 }; + + // TODO: strip the time zone offset off the end + string dateTime = text; + string timeZone = null; + + if (dateTime.IndexOf('Z') > -1) + { + tzIndex = dateTime.LastIndexOf('Z'); + + builder.Kind = DateTimeKind.Utc; + } + else if (dateTime.LastIndexOf('+') > 10) + { + tzIndex = dateTime.LastIndexOf('+'); + } + else if (dateTime.LastIndexOf('-') > 10) + { + tzIndex = dateTime.LastIndexOf('-'); + } + + if (tzIndex > -1) + { + timeZone = dateTime.Substring(tzIndex); + dateTime = dateTime.Substring(0, tzIndex); + } + + string date = (timeIndex == -1) ? dateTime : dateTime.Substring(0, timeIndex); + + var dateParts = date.Split(Seperator.Dash); // '-' + + for (int i = 0; i < dateParts.Length; i++) + { + var part = dateParts[i]; + + switch (i) + { + case 0: builder.Year = int.Parse(part); break; + case 1: builder.Month = int.Parse(part); break; + case 2: builder.Day = int.Parse(part); break; + } + } + + if (timeIndex > -1) + { + string[] timeParts = dateTime.Substring(timeIndex + 1).Split(timeSeperators); + + for (int i = 0; i < timeParts.Length; i++) + { + var part = timeParts[i]; + + switch (i) + { + case 0: builder.Hour = int.Parse(part); break; + case 1: builder.Minute = int.Parse(part); break; + case 2: builder.Second = int.Parse(part); break; + case 3: builder.Millisecond = double.Parse("0." + part) * 1000; break; + } + } + } + + if (timeZone != null && timeZone != "Z") + { + var hours = int.Parse(timeZone.Substring(1, 2)); + var minutes = int.Parse(timeZone.Substring(4, 2)); + + if (timeZone[0] == '-') + { + hours = -hours; + minutes = -minutes; + } + + builder.Offset = new TimeSpan(hours, minutes, 0); + } + + return builder; + } + } + + /* + YYYY # eg 1997 + YYYY-MM # eg 1997-07 + YYYY-MM-DD # eg 1997-07-16 + YYYY-MM-DDThh:mmTZD # eg 1997-07-16T19:20+01:00 + YYYY-MM-DDThh:mm:ssTZD # eg 1997-07-16T19:20:30+01:00 + YYYY-MM-DDThh:mm:ss.sTZD # eg 1997-07-16T19:20:30.45+01:00 + + where: + + YYYY = four-digit year + MM = two-digit month (01=January, etc.) + DD = two-digit day of month (01 through 31) + hh = two digits of hour (00 through 23) (am/pm NOT allowed) + mm = two digits of minute (00 through 59) + ss = two digits of second (00 through 59) + s = one or more digits representing a decimal fraction of a second + TZD = time zone designator (Z or +hh:mm or -hh:mm) + */ +} diff --git a/swaggerci/storage/generated/runtime/JsonType.cs b/swaggerci/storage/generated/runtime/JsonType.cs new file mode 100644 index 000000000000..637d96b695aa --- /dev/null +++ b/swaggerci/storage/generated/runtime/JsonType.cs @@ -0,0 +1,18 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal enum JsonType + { + Null = 0, + Object = 1, + Array = 2, + Binary = 3, + Boolean = 4, + Date = 5, + Number = 6, + String = 7 + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/MessageAttribute.cs b/swaggerci/storage/generated/runtime/MessageAttribute.cs new file mode 100644 index 000000000000..85d6fae39399 --- /dev/null +++ b/swaggerci/storage/generated/runtime/MessageAttribute.cs @@ -0,0 +1,360 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Linq; + using System.Management.Automation; + using System.Text; + + [AttributeUsage(AttributeTargets.All)] + public class GenericBreakingChangeAttribute : Attribute + { + private string _message; + //A dexcription of what the change is about, non mandatory + public string ChangeDescription { get; set; } = null; + + //The version the change is effective from, non mandatory + public string DeprecateByVersion { get; } + public bool DeprecateByVersionSet { get; } = false; + + //The date on which the change comes in effect + public DateTime ChangeInEfectByDate { get; } + public bool ChangeInEfectByDateSet { get; } = false; + + //Old way of calling the cmdlet + public string OldWay { get; set; } + //New way fo calling the cmdlet + public string NewWay { get; set; } + + public GenericBreakingChangeAttribute(string message) + { + _message = message; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + } + + public GenericBreakingChangeAttribute(string message, string deprecateByVersion, string changeInEfectByDate) + { + _message = message; + this.DeprecateByVersion = deprecateByVersion; + this.DeprecateByVersionSet = true; + + if (DateTime.TryParse(changeInEfectByDate, new CultureInfo("en-US"), DateTimeStyles.None, out DateTime result)) + { + this.ChangeInEfectByDate = result; + this.ChangeInEfectByDateSet = true; + } + } + + public DateTime getInEffectByDate() + { + return this.ChangeInEfectByDate.Date; + } + + + /** + * This function prints out the breaking change message for the attribute on the cmdline + * */ + public void PrintCustomAttributeInfo(Action writeOutput) + { + + if (!GetAttributeSpecificMessage().StartsWith(Environment.NewLine)) + { + writeOutput(Environment.NewLine); + } + writeOutput(string.Format(Resources.BreakingChangesAttributesDeclarationMessage, GetAttributeSpecificMessage())); + + + if (!string.IsNullOrWhiteSpace(ChangeDescription)) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesChangeDescriptionMessage, this.ChangeDescription)); + } + + if (ChangeInEfectByDateSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByDateMessage, this.ChangeInEfectByDate.ToString("d"))); + } + + if (DeprecateByVersionSet) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesInEffectByVersion, this.DeprecateByVersion)); + } + + if (OldWay != null && NewWay != null) + { + writeOutput(string.Format(Resources.BreakingChangesAttributesUsageChangeMessageConsole, OldWay, NewWay)); + } + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + + protected virtual string GetAttributeSpecificMessage() + { + return _message; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class CmdletBreakingChangeAttribute : GenericBreakingChangeAttribute + { + + public string ReplacementCmdletName { get; set; } + + public CmdletBreakingChangeAttribute() : + base(string.Empty) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + } + + public CmdletBreakingChangeAttribute(string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + } + + protected override string GetAttributeSpecificMessage() + { + if (string.IsNullOrWhiteSpace(ReplacementCmdletName)) + { + return Resources.BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement; + } + else + { + return string.Format(Resources.BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement, ReplacementCmdletName); + } + } + } + + [AttributeUsage(AttributeTargets.All)] + public class ParameterSetBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string[] ChangedParameterSet { set; get; } + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet) : + base(string.Empty) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersione) : + base(string.Empty, deprecateByVersione) + { + ChangedParameterSet = changedParameterSet; + } + + public ParameterSetBreakingChangeAttribute(string[] changedParameterSet, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + ChangedParameterSet = changedParameterSet; + } + + protected override string GetAttributeSpecificMessage() + { + + return Resources.BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement; + + } + + public bool IsApplicableToInvocation(InvocationInfo invocation, string parameterSetName) + { + if (ChangedParameterSet != null) + return ChangedParameterSet.Contains(parameterSetName); + return false; + } + + } + + [AttributeUsage(AttributeTargets.All)] + public class PreviewMessageAttribute : Attribute + { + public string _message; + + public PreviewMessageAttribute() + { + this._message = Resources.PreviewCmdletMessage; + } + + public PreviewMessageAttribute(string message) + { + this._message = message; + } + + public void PrintCustomAttributeInfo(System.Management.Automation.PSCmdlet psCmdlet) + { + psCmdlet.WriteWarning(this._message); + } + + public virtual bool IsApplicableToInvocation(InvocationInfo invocation) + { + return true; + } + } + + [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field)] + public class ParameterBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string NameOfParameterChanging { get; } + + public string ReplaceMentCmdletParameterName { get; set; } = null; + + public bool IsBecomingMandatory { get; set; } = false; + + public String OldParamaterType { get; set; } + + public String NewParameterType { get; set; } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging) : + base(string.Empty) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + public ParameterBreakingChangeAttribute(string nameOfParameterChanging, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.NameOfParameterChanging = nameOfParameterChanging; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + if (!string.IsNullOrWhiteSpace(ReplaceMentCmdletParameterName)) + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplacedMandatory, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterReplaced, NameOfParameterChanging, ReplaceMentCmdletParameterName)); + } + } + else + { + if (IsBecomingMandatory) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterMandatoryNow, NameOfParameterChanging)); + } + else + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterChanging, NameOfParameterChanging)); + } + } + + //See if the type of the param is changing + if (OldParamaterType != null && !string.IsNullOrWhiteSpace(NewParameterType)) + { + message.Append(string.Format(Resources.BreakingChangeAttributeParameterTypeChange, OldParamaterType, NewParameterType)); + } + return message.ToString(); + } + + /// + /// See if the bound parameters contain the current parameter, if they do + /// then the attribbute is applicable + /// If the invocationInfo is null we return true + /// + /// + /// bool + public override bool IsApplicableToInvocation(InvocationInfo invocationInfo) + { + bool? applicable = invocationInfo == null ? true : invocationInfo.BoundParameters?.Keys?.Contains(this.NameOfParameterChanging); + return applicable.HasValue ? applicable.Value : false; + } + } + + [AttributeUsage(AttributeTargets.All)] + public class OutputBreakingChangeAttribute : GenericBreakingChangeAttribute + { + public string DeprecatedCmdLetOutputType { get; } + + //This is still a String instead of a Type as this + //might be undefined at the time of adding the attribute + public string ReplacementCmdletOutputType { get; set; } + + public string[] DeprecatedOutputProperties { get; set; } + + public string[] NewOutputProperties { get; set; } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType) : + base(string.Empty) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion) : + base(string.Empty, deprecateByVersion) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + public OutputBreakingChangeAttribute(string deprecatedCmdletOutputType, string deprecateByVersion, string changeInEfectByDate) : + base(string.Empty, deprecateByVersion, changeInEfectByDate) + { + this.DeprecatedCmdLetOutputType = deprecatedCmdletOutputType; + } + + protected override string GetAttributeSpecificMessage() + { + StringBuilder message = new StringBuilder(); + + //check for the deprecation scenario + if (string.IsNullOrWhiteSpace(ReplacementCmdletOutputType) && NewOutputProperties == null && DeprecatedOutputProperties == null && string.IsNullOrWhiteSpace(ChangeDescription)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputTypeDeprecated, DeprecatedCmdLetOutputType)); + } + else + { + if (!string.IsNullOrWhiteSpace(ReplacementCmdletOutputType)) + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange1, DeprecatedCmdLetOutputType, ReplacementCmdletOutputType)); + } + else + { + message.Append(string.Format(Resources.BreakingChangesAttributesCmdLetOutputChange2, DeprecatedCmdLetOutputType)); + } + + if (DeprecatedOutputProperties != null && DeprecatedOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesRemoved); + foreach (string property in DeprecatedOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + + if (NewOutputProperties != null && NewOutputProperties.Length > 0) + { + message.Append(Resources.BreakingChangesAttributesCmdLetOutputPropertiesAdded); + foreach (string property in NewOutputProperties) + { + message.Append(" '" + property + "'"); + } + } + } + return message.ToString(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/MessageAttributeHelper.cs b/swaggerci/storage/generated/runtime/MessageAttributeHelper.cs new file mode 100644 index 000000000000..aed37fc12e90 --- /dev/null +++ b/swaggerci/storage/generated/runtime/MessageAttributeHelper.cs @@ -0,0 +1,161 @@ +// ---------------------------------------------------------------------------------- +// +// Copyright Microsoft Corporation +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// ---------------------------------------------------------------------------------- +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using Microsoft.Azure.PowerShell.Cmdlets.Storage.generated.runtime.Properties; + using System; + using System.Collections.Generic; + using System.Linq; + using System.Management.Automation; + using System.Reflection; + using System.Text; + using System.Threading.Tasks; + public class MessageAttributeHelper + { + public const string BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK = "https://aka.ms/azps-changewarnings"; + public const string SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME = "SuppressAzurePowerShellBreakingChangeWarnings"; + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And reads all the deprecation attributes attached to it + * Prints a message on the cmdline For each of the attribute found + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + * */ + public static void ProcessCustomAttributesAtRuntime(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet, System.Management.Automation.PSCmdlet psCmdlet) + { + bool supressWarningOrError = false; + + try + { + supressWarningOrError = bool.Parse(System.Environment.GetEnvironmentVariable(SUPPRESS_ERROR_OR_WARNING_MESSAGE_ENV_VARIABLE_NAME)); + } + catch (Exception) + { + //no action + } + + if (supressWarningOrError) + { + //Do not process the attributes at runtime... The env variable to override the warning messages is set + return; + } + + List attributes = new List(GetAllBreakingChangeAttributesInType(commandInfo, invocationInfo, parameterSet)); + StringBuilder sb = new StringBuilder(); + Action appendBreakingChangeInfo = (string s) => sb.Append(s); + + if (attributes != null && attributes.Count > 0) + { + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesHeaderMessage, commandInfo.Name.Split('_')[0])); + + foreach (GenericBreakingChangeAttribute attribute in attributes) + { + attribute.PrintCustomAttributeInfo(appendBreakingChangeInfo); + } + + appendBreakingChangeInfo(string.Format(Resources.BreakingChangesAttributesFooterMessage, BREAKING_CHANGE_ATTRIBUTE_INFORMATION_LINK)); + + psCmdlet.WriteWarning(sb.ToString()); + } + + List previewAttributes = new List(GetAllPreviewAttributesInType(commandInfo, invocationInfo)); + + if (previewAttributes != null && previewAttributes.Count > 0) + { + foreach (PreviewMessageAttribute attribute in previewAttributes) + { + attribute.PrintCustomAttributeInfo(psCmdlet); + } + } + } + + + /** + * This function takes in a CommandInfo (CmdletInfo or FunctionInfo) + * And returns all the deprecation attributes attached to it + * + * the boundParameterNames is a list of parameters bound to the cmdlet at runtime, + * We only process the Parameter beaking change attributes attached only params listed in this list (if present) + **/ + private static IEnumerable GetAllBreakingChangeAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo, String parameterSet) + { + List attributeList = new List(); + + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(GenericBreakingChangeAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(GenericBreakingChangeAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.GetType() == typeof(ParameterSetBreakingChangeAttribute) ? ((ParameterSetBreakingChangeAttribute)e).IsApplicableToInvocation(invocationInfo, parameterSet) : e.IsApplicableToInvocation(invocationInfo)); + } + private static IEnumerable GetAllPreviewAttributesInType(CommandInfo commandInfo, InvocationInfo invocationInfo) + { + List attributeList = new List(); + if (commandInfo.GetType() == typeof(CmdletInfo)) + { + var type = ((CmdletInfo)commandInfo).ImplementingType; + attributeList.AddRange(type.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + + foreach (MethodInfo m in type.GetRuntimeMethods()) + { + attributeList.AddRange((m.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast())); + } + + foreach (FieldInfo f in type.GetRuntimeFields()) + { + attributeList.AddRange(f.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + + foreach (PropertyInfo p in type.GetRuntimeProperties()) + { + attributeList.AddRange(p.GetCustomAttributes(typeof(PreviewMessageAttribute), false).Cast()); + } + } + else if (commandInfo.GetType() == typeof(FunctionInfo)) + { + attributeList.AddRange(((FunctionInfo)commandInfo).ScriptBlock.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + foreach (var parameter in ((FunctionInfo)commandInfo).Parameters) + { + attributeList.AddRange(parameter.Value.Attributes.Where(e => typeof(PreviewMessageAttribute).IsAssignableFrom(e.GetType())).Cast()); + } + } + return invocationInfo == null ? attributeList : attributeList.Where(e => e.IsApplicableToInvocation(invocationInfo)); + } + } +} diff --git a/swaggerci/storage/generated/runtime/Method.cs b/swaggerci/storage/generated/runtime/Method.cs new file mode 100644 index 000000000000..3f0d8968fe8d --- /dev/null +++ b/swaggerci/storage/generated/runtime/Method.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + internal static class Method + { + internal static System.Net.Http.HttpMethod Get = System.Net.Http.HttpMethod.Get; + internal static System.Net.Http.HttpMethod Put = System.Net.Http.HttpMethod.Put; + internal static System.Net.Http.HttpMethod Head = System.Net.Http.HttpMethod.Head; + internal static System.Net.Http.HttpMethod Post = System.Net.Http.HttpMethod.Post; + internal static System.Net.Http.HttpMethod Delete = System.Net.Http.HttpMethod.Delete; + internal static System.Net.Http.HttpMethod Options = System.Net.Http.HttpMethod.Options; + internal static System.Net.Http.HttpMethod Trace = System.Net.Http.HttpMethod.Trace; + internal static System.Net.Http.HttpMethod Patch = new System.Net.Http.HttpMethod("PATCH"); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Models/JsonMember.cs b/swaggerci/storage/generated/runtime/Models/JsonMember.cs new file mode 100644 index 000000000000..2dbcafc25d25 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Models/JsonMember.cs @@ -0,0 +1,83 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Reflection; +using System.Runtime.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + + + internal sealed class JsonMember + { + private readonly TypeDetails type; + + private readonly Func getter; + private readonly Action setter; + + internal JsonMember(PropertyInfo property, int defaultOrder) + { + getter = property.GetValue; + setter = property.SetValue; + + var dataMember = property.GetCustomAttribute(); + + Name = dataMember?.Name ?? property.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(property.PropertyType); + + CanRead = property.CanRead; + } + + internal JsonMember(FieldInfo field, int defaultOrder) + { + getter = field.GetValue; + setter = field.SetValue; + + var dataMember = field.GetCustomAttribute(); + + Name = dataMember?.Name ?? field.Name; + Order = dataMember?.Order ?? defaultOrder; + EmitDefaultValue = dataMember?.EmitDefaultValue ?? true; + + this.type = TypeDetails.Get(field.FieldType); + + CanRead = true; + } + + internal string Name { get; } + + internal int Order { get; } + + internal TypeDetails TypeDetails => type; + + internal Type Type => type.NonNullType; + + internal bool IsList => type.IsList; + + // Arrays, Sets, ... + internal Type ElementType => type.ElementType; + + internal IJsonConverter Converter => type.JsonConverter; + + internal bool EmitDefaultValue { get; } + + internal bool IsStringLike => type.IsStringLike; + + internal object DefaultValue => type.DefaultValue; + + internal bool CanRead { get; } + + #region Helpers + + internal object GetValue(object instance) => getter(instance); + + internal void SetValue(object instance, object value) => setter(instance, value); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Models/JsonModel.cs b/swaggerci/storage/generated/runtime/Models/JsonModel.cs new file mode 100644 index 000000000000..0e63758481e4 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Models/JsonModel.cs @@ -0,0 +1,89 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.Runtime.Serialization; +using System.Reflection; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal class JsonModel + { + private Dictionary map; + private readonly object _sync = new object(); + + private JsonModel(Type type, List members) + { + Type = type ?? throw new ArgumentNullException(nameof(type)); + Members = members ?? throw new ArgumentNullException(nameof(members)); + } + + internal string Name => Type.Name; + + internal Type Type { get; } + + internal List Members { get; } + + internal JsonMember this[string name] + { + get + { + if (map == null) + { + lock (_sync) + { + if (map == null) + { + map = new Dictionary(); + + foreach (JsonMember m in Members) + { + map[m.Name.ToLower()] = m; + } + } + } + } + + + map.TryGetValue(name.ToLower(), out JsonMember member); + + return member; + } + } + + internal static JsonModel FromType(Type type) + { + var members = new List(); + + int i = 0; + + // BindingFlags.Instance | BindingFlags.Public + + foreach (var member in type.GetFields()) + { + if (member.IsStatic) continue; + + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + foreach (var member in type.GetProperties(BindingFlags.Public | BindingFlags.Instance)) + { + if (member.IsDefined(typeof(IgnoreDataMemberAttribute))) continue; + + members.Add(new JsonMember(member, i)); + + i++; + } + + members.Sort((a, b) => a.Order.CompareTo(b.Order)); // inline sort + + return new JsonModel(type, members); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Models/JsonModelCache.cs b/swaggerci/storage/generated/runtime/Models/JsonModelCache.cs new file mode 100644 index 000000000000..707ad24d8d3d --- /dev/null +++ b/swaggerci/storage/generated/runtime/Models/JsonModelCache.cs @@ -0,0 +1,19 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Runtime.CompilerServices; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal static class JsonModelCache + { + private static readonly ConditionalWeakTable cache + = new ConditionalWeakTable(); + + internal static JsonModel Get(Type type) => cache.GetValue(type, Create); + + private static JsonModel Create(Type type) => JsonModel.FromType(type); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/Collections/JsonArray.cs b/swaggerci/storage/generated/runtime/Nodes/Collections/JsonArray.cs new file mode 100644 index 000000000000..71a2e3c9952f --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/Collections/JsonArray.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public abstract partial class JsonArray : JsonNode, IEnumerable + { + internal override JsonType Type => JsonType.Array; + + internal abstract JsonType? ElementType { get; } + + public abstract int Count { get; } + + internal virtual bool IsSet => false; + + internal bool IsEmpty => Count == 0; + + #region IEnumerable + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + throw new NotImplementedException(); + } + + #endregion + + #region Static Helpers + + internal static JsonArray Create(short[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(int[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(long[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(decimal[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(float[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(string[] values) + => new XImmutableArray(values); + + internal static JsonArray Create(XBinary[] values) + => new XImmutableArray(values); + + #endregion + + internal static new JsonArray Parse(string text) + => (JsonArray)JsonNode.Parse(text); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/Collections/XImmutableArray.cs b/swaggerci/storage/generated/runtime/Nodes/Collections/XImmutableArray.cs new file mode 100644 index 000000000000..89956b958e20 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/Collections/XImmutableArray.cs @@ -0,0 +1,62 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal sealed class XImmutableArray : JsonArray, IEnumerable + { + private readonly T[] values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XImmutableArray(T[] values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Length; + + public bool IsReadOnly => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (T value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + #region Static Constructor + + internal XImmutableArray Create(T[] items) + { + return new XImmutableArray(items); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/Collections/XList.cs b/swaggerci/storage/generated/runtime/Nodes/Collections/XList.cs new file mode 100644 index 000000000000..e440a67fe880 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/Collections/XList.cs @@ -0,0 +1,64 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal sealed class XList : JsonArray, IEnumerable + { + private readonly IList values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XList(IList values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + public override JsonNode this[int index] => + XHelper.Create(elementType, elementCode, values[index]); + + internal override JsonType? ElementType => elementType; + + public override int Count => values.Count; + + public bool IsReadOnly => values.IsReadOnly; + + #region IList + + public void Add(T value) + { + values.Add(value); + } + + public bool Contains(T value) => values.Contains(value); + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/Collections/XNodeArray.cs b/swaggerci/storage/generated/runtime/Nodes/Collections/XNodeArray.cs new file mode 100644 index 000000000000..040b01728d82 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/Collections/XNodeArray.cs @@ -0,0 +1,68 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed partial class XNodeArray : JsonArray, ICollection + { + private readonly List items; + + internal XNodeArray() + { + items = new List(); + } + + internal XNodeArray(params JsonNode[] values) + { + items = new List(values); + } + + public override JsonNode this[int index] => items[index]; + + internal override JsonType? ElementType => null; + + public bool IsReadOnly => false; + + public override int Count => items.Count; + + #region ICollection Members + + public void Add(JsonNode item) + { + items.Add(item); + } + + void ICollection.Clear() + { + items.Clear(); + } + + public bool Contains(JsonNode item) => items.Contains(item); + + void ICollection.CopyTo(JsonNode[] array, int arrayIndex) + { + items.CopyTo(array, arrayIndex); + } + + public bool Remove(JsonNode item) + { + return items.Remove(item); + } + + #endregion + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/Collections/XSet.cs b/swaggerci/storage/generated/runtime/Nodes/Collections/XSet.cs new file mode 100644 index 000000000000..c717ce053fe6 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/Collections/XSet.cs @@ -0,0 +1,60 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal sealed class XSet : JsonArray, IEnumerable + { + private readonly HashSet values; + private readonly JsonType elementType; + private readonly TypeCode elementCode; + + internal XSet(IEnumerable values) + : this(new HashSet(values)) + { } + + internal XSet(HashSet values) + { + this.values = values ?? throw new ArgumentNullException(nameof(values)); + this.elementCode = System.Type.GetTypeCode(typeof(T)); + this.elementType = XHelper.GetElementType(this.elementCode); + } + + internal override JsonType Type => JsonType.Array; + + internal override JsonType? ElementType => elementType; + + public bool IsReadOnly => true; + + public override int Count => values.Count; + + internal override bool IsSet => true; + + #region IEnumerable Members + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + foreach (var value in values) + { + yield return XHelper.Create(elementType, elementCode, value); + } + } + + #endregion + + internal HashSet AsHashSet() => values; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/JsonBoolean.cs b/swaggerci/storage/generated/runtime/Nodes/JsonBoolean.cs new file mode 100644 index 000000000000..5d439533da3b --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/JsonBoolean.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal sealed partial class JsonBoolean : JsonNode + { + internal static readonly JsonBoolean True = new JsonBoolean(true); + internal static readonly JsonBoolean False = new JsonBoolean(false); + + internal JsonBoolean(bool value) + { + Value = value; + } + + internal bool Value { get; } + + internal override JsonType Type => JsonType.Boolean; + + internal static new JsonBoolean Parse(string text) + { + switch (text) + { + case "false": return False; + case "true": return True; + + default: throw new ArgumentException($"Expected true or false. Was {text}."); + } + } + + #region Implicit Casts + + public static implicit operator bool(JsonBoolean data) => data.Value; + + public static implicit operator JsonBoolean(bool data) => new JsonBoolean(data); + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/JsonDate.cs b/swaggerci/storage/generated/runtime/Nodes/JsonDate.cs new file mode 100644 index 000000000000..f62af1b0239e --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/JsonDate.cs @@ -0,0 +1,173 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + + + internal sealed partial class JsonDate : JsonNode, IEquatable, IComparable + { + internal static bool AssumeUtcWhenKindIsUnspecified = true; + + private readonly DateTimeOffset value; + + internal JsonDate(DateTime value) + { + if (value.Kind == DateTimeKind.Unspecified && AssumeUtcWhenKindIsUnspecified) + { + value = DateTime.SpecifyKind(value, DateTimeKind.Utc); + } + + this.value = value; + } + + internal JsonDate(DateTimeOffset value) + { + this.value = value; + } + + internal override JsonType Type => JsonType.Date; + + #region Helpers + + internal DateTimeOffset ToDateTimeOffset() + { + return value; + } + + internal DateTime ToDateTime() + { + if (value.Offset == TimeSpan.Zero) + { + return value.UtcDateTime; + } + + return value.DateTime; + } + + internal DateTime ToUtcDateTime() => value.UtcDateTime; + + internal int ToUnixTimeSeconds() + { + return (int)value.ToUnixTimeSeconds(); + } + + internal long ToUnixTimeMilliseconds() + { + return (int)value.ToUnixTimeMilliseconds(); + } + + internal string ToIsoString() + { + return IsoDate.FromDateTimeOffset(value).ToString(); + } + + #endregion + + public override string ToString() + { + return ToIsoString(); + } + + internal static new JsonDate Parse(string text) + { + if (text == null) throw new ArgumentNullException(nameof(text)); + + // TODO support: unixtimeseconds.partialseconds + + if (text.Length > 4 && _IsNumber(text)) // UnixTime + { + var date = DateTimeOffset.FromUnixTimeSeconds(long.Parse(text)); + + return new JsonDate(date); + } + else if (text.Length <= 4 || text[4] == '-') // ISO: 2012- + { + return new JsonDate(IsoDate.Parse(text).ToDateTimeOffset()); + } + else + { + // NOT ISO ENCODED + // "Thu, 5 Apr 2012 16:59:01 +0200", + return new JsonDate(DateTimeOffset.Parse(text)); + } + } + + private static bool _IsNumber(string text) + { + foreach (var c in text) + { + if (!char.IsDigit(c)) return false; + } + + return true; + } + + internal static JsonDate FromUnixTime(int seconds) + { + return new JsonDate(DateTimeOffset.FromUnixTimeSeconds(seconds)); + } + + internal static JsonDate FromUnixTime(double seconds) + { + var milliseconds = (long)(seconds * 1000d); + + return new JsonDate(DateTimeOffset.FromUnixTimeMilliseconds(milliseconds)); + } + + #region Implicit Casts + + public static implicit operator DateTimeOffset(JsonDate value) + => value.ToDateTimeOffset(); + + public static implicit operator DateTime(JsonDate value) + => value.ToDateTime(); + + // From Date + public static implicit operator JsonDate(DateTimeOffset value) + { + return new JsonDate(value); + } + + public static implicit operator JsonDate(DateTime value) + { + return new JsonDate(value); + } + + // From String + public static implicit operator JsonDate(string value) + { + return Parse(value); + } + + #endregion + + #region Equality + + public override bool Equals(object obj) + { + return obj is JsonDate date && date.value == this.value; + } + + public bool Equals(JsonDate other) + { + return this.value == other.value; + } + + public override int GetHashCode() => value.GetHashCode(); + + #endregion + + #region IComparable Members + + int IComparable.CompareTo(JsonDate other) + { + return value.CompareTo(other.value); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/JsonNode.cs b/swaggerci/storage/generated/runtime/Nodes/JsonNode.cs new file mode 100644 index 000000000000..791cc4bfb485 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/JsonNode.cs @@ -0,0 +1,250 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.IO; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + + + public abstract partial class JsonNode + { + internal abstract JsonType Type { get; } + + public virtual JsonNode this[int index] => throw new NotImplementedException(); + + public virtual JsonNode this[string name] + { + get => throw new NotImplementedException(); + set => throw new NotImplementedException(); + } + + #region Type Helpers + + internal bool IsArray => Type == JsonType.Array; + + internal bool IsDate => Type == JsonType.Date; + + internal bool IsObject => Type == JsonType.Object; + + internal bool IsNumber => Type == JsonType.Number; + + internal bool IsNull => Type == JsonType.Null; + + #endregion + + internal void WriteTo(TextWriter textWriter, bool pretty = true) + { + var writer = new JsonWriter(textWriter, pretty); + + writer.WriteNode(this); + } + + internal T As() + where T : new() + => new JsonSerializer().Deseralize((JsonObject)this); + + internal T[] ToArrayOf() + { + return (T[])new JsonSerializer().DeserializeArray(typeof(T[]), (JsonArray)this); + } + + #region ToString Overrides + + public override string ToString() => ToString(pretty: true); + + internal string ToString(bool pretty) + { + var sb = new StringBuilder(); + + using (var writer = new StringWriter(sb)) + { + WriteTo(writer, pretty); + + return sb.ToString(); + } + } + + #endregion + + #region Static Constructors + + internal static JsonNode Parse(string text) + { + return Parse(new SourceReader(new StringReader(text))); + } + + internal static JsonNode Parse(TextReader textReader) + => Parse(new SourceReader(textReader)); + + private static JsonNode Parse(SourceReader sourceReader) + { + using (var parser = new JsonParser(sourceReader)) + { + return parser.ReadNode(); + } + } + + internal static JsonNode FromObject(object instance) + => new JsonSerializer().Serialize(instance); + + #endregion + + #region Implict Casts + + public static implicit operator string(JsonNode node) => node.ToString(); + + #endregion + + #region Explict Casts + + public static explicit operator DateTime(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date: + return ((JsonDate)node).ToDateTime(); + + case JsonType.String: + return JsonDate.Parse(node.ToString()).ToDateTime(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num).UtcDateTime; + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)).UtcDateTime; + } + } + + throw new ConversionException(node, typeof(DateTime)); + } + + public static explicit operator DateTimeOffset(JsonNode node) + { + switch (node.Type) + { + case JsonType.Date : return ((JsonDate)node).ToDateTimeOffset(); + case JsonType.String : return JsonDate.Parse(node.ToString()).ToDateTimeOffset(); + + case JsonType.Number: + var num = (JsonNumber)node; + + if (num.IsInteger) + { + return DateTimeOffset.FromUnixTimeSeconds(num); + } + else + { + return DateTimeOffset.FromUnixTimeMilliseconds((long)((double)num * 1000)); + } + + } + + throw new ConversionException(node, typeof(DateTimeOffset)); + } + + public static explicit operator float(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return float.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(float)); + } + + public static explicit operator double(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return double.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(double)); + } + + public static explicit operator decimal(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return decimal.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(decimal)); + } + + public static explicit operator Guid(JsonNode node) + => new Guid(node.ToString()); + + public static explicit operator short(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return short.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(short)); + } + + public static explicit operator int(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number : return (JsonNumber)node; + case JsonType.String : return int.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(int)); + } + + public static explicit operator long(JsonNode node) + { + switch (node.Type) + { + case JsonType.Number: return (JsonNumber)node; + case JsonType.String: return long.Parse(node.ToString()); + } + + throw new ConversionException(node, typeof(long)); + } + + public static explicit operator bool(JsonNode node) + => ((JsonBoolean)node).Value; + + public static explicit operator ushort(JsonNode node) + => (JsonNumber)node; + + public static explicit operator uint(JsonNode node) + => (JsonNumber)node; + + public static explicit operator ulong(JsonNode node) + => (JsonNumber)node; + + public static explicit operator TimeSpan(JsonNode node) + => TimeSpan.Parse(node.ToString()); + + public static explicit operator Uri(JsonNode node) + { + if (node.Type == JsonType.String) + { + return new Uri(node.ToString()); + } + + throw new ConversionException(node, typeof(Uri)); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/JsonNumber.cs b/swaggerci/storage/generated/runtime/Nodes/JsonNumber.cs new file mode 100644 index 000000000000..c4087170d3c3 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/JsonNumber.cs @@ -0,0 +1,109 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed partial class JsonNumber : JsonNode + { + private readonly string value; + private readonly bool overflows = false; + + internal JsonNumber(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal JsonNumber(int value) + { + this.value = value.ToString(); + } + + internal JsonNumber(long value) + { + this.value = value.ToString(); + + if (value > 9007199254740991) + { + overflows = true; + } + } + + internal JsonNumber(float value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal JsonNumber(double value) + { + this.value = value.ToString(System.Globalization.CultureInfo.InvariantCulture); + } + + internal override JsonType Type => JsonType.Number; + + internal string Value => value; + + #region Helpers + + internal bool Overflows => overflows; + + internal bool IsInteger => !value.Contains("."); + + internal bool IsFloat => value.Contains("."); + + #endregion + + #region Casting + + public static implicit operator byte(JsonNumber number) + => byte.Parse(number.Value); + + public static implicit operator short(JsonNumber number) + => short.Parse(number.Value); + + public static implicit operator int(JsonNumber number) + => int.Parse(number.Value); + + public static implicit operator long(JsonNumber number) + => long.Parse(number.value); + + public static implicit operator UInt16(JsonNumber number) + => ushort.Parse(number.Value); + + public static implicit operator UInt32(JsonNumber number) + => uint.Parse(number.Value); + + public static implicit operator UInt64(JsonNumber number) + => ulong.Parse(number.Value); + + public static implicit operator decimal(JsonNumber number) + => decimal.Parse(number.Value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator Double(JsonNumber number) + => double.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator float(JsonNumber number) + => float.Parse(number.value, System.Globalization.CultureInfo.InvariantCulture); + + public static implicit operator JsonNumber(short data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(int data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(long data) + => new JsonNumber(data); + + public static implicit operator JsonNumber(Single data) + => new JsonNumber(data.ToString()); + + public static implicit operator JsonNumber(double data) + => new JsonNumber(data.ToString()); + + #endregion + + public override string ToString() => value; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/JsonObject.cs b/swaggerci/storage/generated/runtime/Nodes/JsonObject.cs new file mode 100644 index 000000000000..0f3fcee0d2cf --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/JsonObject.cs @@ -0,0 +1,172 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public partial class JsonObject : JsonNode, IDictionary + { + private readonly Dictionary items; + + internal JsonObject() + { + items = new Dictionary(); + } + + internal JsonObject(IEnumerable> properties) + { + if (properties == null) throw new ArgumentNullException(nameof(properties)); + + items = new Dictionary(); + + foreach (var field in properties) + { + items.Add(field.Key, field.Value); + } + } + + #region IDictionary Constructors + + internal JsonObject(IDictionary dic) + { + items = new Dictionary(dic.Count); + + foreach (var pair in dic) + { + Add(pair.Key, pair.Value); + } + } + + #endregion + + internal override JsonType Type => JsonType.Object; + + #region Add Overloads + + public void Add(string name, JsonNode value) => + items.Add(name, value); + + public void Add(string name, byte[] value) => + items.Add(name, new XBinary(value)); + + public void Add(string name, DateTime value) => + items.Add(name, new JsonDate(value)); + + public void Add(string name, int value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, long value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, float value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, double value) => + items.Add(name, new JsonNumber(value.ToString())); + + public void Add(string name, string value) => + items.Add(name, new JsonString(value)); + + public void Add(string name, bool value) => + items.Add(name, new JsonBoolean(value)); + + public void Add(string name, Uri url) => + items.Add(name, new JsonString(url.AbsoluteUri)); + + public void Add(string name, string[] values) => + items.Add(name, new XImmutableArray(values)); + + public void Add(string name, int[] values) => + items.Add(name, new XImmutableArray(values)); + + #endregion + + #region ICollection> Members + + void ICollection>.Add(KeyValuePair item) + { + items.Add(item.Key, item.Value); + } + + void ICollection>.Clear() + { + items.Clear(); + } + + bool ICollection>.Contains(KeyValuePair item) => + throw new NotImplementedException(); + + void ICollection>.CopyTo(KeyValuePair[] array, int arrayIndex) => + throw new NotImplementedException(); + + + int ICollection>.Count => items.Count; + + bool ICollection>.IsReadOnly => false; + + bool ICollection>.Remove(KeyValuePair item) => + throw new NotImplementedException(); + + #endregion + + #region IDictionary Members + + public bool ContainsKey(string key) => items.ContainsKey(key); + + public ICollection Keys => items.Keys; + + public bool Remove(string key) => items.Remove(key); + + public bool TryGetValue(string key, out JsonNode value) => + items.TryGetValue(key, out value); + + public ICollection Values => items.Values; + + public override JsonNode this[string key] + { + get => items[key]; + set => items[key] = value; + } + + #endregion + + #region IEnumerable + + IEnumerator> IEnumerable>.GetEnumerator() + => items.GetEnumerator(); + + IEnumerator IEnumerable.GetEnumerator() + => items.GetEnumerator(); + + #endregion + + #region Helpers + + internal static new JsonObject FromObject(object instance) => + (JsonObject)new JsonSerializer().Serialize(instance); + + #endregion + + #region Static Constructors + + internal static JsonObject FromStream(Stream stream) + { + using (var tr = new StreamReader(stream)) + { + return (JsonObject)Parse(tr); + } + } + + internal static new JsonObject Parse(string text) + { + return (JsonObject)JsonNode.Parse(text); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/JsonString.cs b/swaggerci/storage/generated/runtime/Nodes/JsonString.cs new file mode 100644 index 000000000000..ff96f8e850fa --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/JsonString.cs @@ -0,0 +1,42 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed partial class JsonString : JsonNode, IEquatable + { + private readonly string value; + + internal JsonString(string value) + { + this.value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal override JsonType Type => JsonType.String; + + internal string Value => value; + + internal int Length => value.Length; + + #region #region Implicit Casts + + public static implicit operator string(JsonString data) => data.Value; + + public static implicit operator JsonString(string value) => new JsonString(value); + + #endregion + + public override int GetHashCode() => value.GetHashCode(); + + public override string ToString() => value; + + #region IEquatable + + bool IEquatable.Equals(JsonString other) => this.Value == other.Value; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/XBinary.cs b/swaggerci/storage/generated/runtime/Nodes/XBinary.cs new file mode 100644 index 000000000000..d1c6ea747a6a --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/XBinary.cs @@ -0,0 +1,40 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal sealed class XBinary : JsonNode + { + private readonly byte[] _value; + private readonly string _base64; + + internal XBinary(byte[] value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + internal XBinary(string base64EncodedString) + { + _base64 = base64EncodedString ?? throw new ArgumentNullException(nameof(base64EncodedString)); + } + + internal override JsonType Type => JsonType.Binary; + + internal byte[] Value => _value ?? Convert.FromBase64String(_base64); + + #region #region Implicit Casts + + public static implicit operator byte[] (XBinary data) => data.Value; + + public static implicit operator XBinary(byte[] data) => new XBinary(data); + + #endregion + + public override int GetHashCode() => Value.GetHashCode(); + + public override string ToString() => _base64 ?? Convert.ToBase64String(_value); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Nodes/XNull.cs b/swaggerci/storage/generated/runtime/Nodes/XNull.cs new file mode 100644 index 000000000000..7eec27f33077 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Nodes/XNull.cs @@ -0,0 +1,15 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal sealed class XNull : JsonNode + { + internal static readonly XNull Instance = new XNull(); + + private XNull() { } + + internal override JsonType Type => JsonType.Null; + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Parser/Exceptions/ParseException.cs b/swaggerci/storage/generated/runtime/Parser/Exceptions/ParseException.cs new file mode 100644 index 000000000000..cc41543b2d5a --- /dev/null +++ b/swaggerci/storage/generated/runtime/Parser/Exceptions/ParseException.cs @@ -0,0 +1,24 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal class ParserException : Exception + { + internal ParserException(string message) + : base(message) + { } + + internal ParserException(string message, SourceLocation location) + : base(message) + { + + Location = location; + } + + internal SourceLocation Location { get; } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Parser/JsonParser.cs b/swaggerci/storage/generated/runtime/Parser/JsonParser.cs new file mode 100644 index 000000000000..fc24e6dca0e5 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Parser/JsonParser.cs @@ -0,0 +1,180 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public class JsonParser : IDisposable + { + private readonly TokenReader reader; + + internal JsonParser(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonParser(SourceReader sourceReader) + { + if (sourceReader == null) + throw new ArgumentNullException(nameof(sourceReader)); + + this.reader = new TokenReader(new JsonTokenizer(sourceReader)); + + this.reader.Next(); // Start with the first token + } + + internal IEnumerable ReadNodes() + { + JsonNode node; + + while ((node = ReadNode()) != null) yield return node; + } + + internal JsonNode ReadNode() + { + if (reader.Current.Kind == TokenKind.Eof || reader.Current.IsTerminator) + { + return null; + } + + switch (reader.Current.Kind) + { + case TokenKind.LeftBrace : return ReadObject(); // { + case TokenKind.LeftBracket : return ReadArray(); // [ + + default: throw new ParserException($"Expected '{{' or '['. Was {reader.Current}."); + } + } + + private JsonNode ReadFieldValue() + { + // Boolean, Date, Null, Number, String, Uri + if (reader.Current.IsLiteral) + { + return ReadLiteral(); + } + else + { + switch (reader.Current.Kind) + { + case TokenKind.LeftBracket: return ReadArray(); + case TokenKind.LeftBrace : return ReadObject(); + + default: throw new ParserException($"Unexpected token reading field value. Was {reader.Current}."); + } + } + } + + private JsonNode ReadLiteral() + { + var literal = reader.Current; + + reader.Next(); // Read the literal token + + switch (literal.Kind) + { + case TokenKind.Boolean : return JsonBoolean.Parse(literal.Value); + case TokenKind.Null : return XNull.Instance; + case TokenKind.Number : return new JsonNumber(literal.Value); + case TokenKind.String : return new JsonString(literal.Value); + + default: throw new ParserException($"Unexpected token reading literal. Was {literal}."); + } + } + + internal JsonObject ReadObject() + { + reader.Ensure(TokenKind.LeftBrace, "object"); + + reader.Next(); // Read '{' (Object start) + + var jsonObject = new JsonObject(); + + // Read the object's fields until we reach the end of the object ('}') + while (reader.Current.Kind != TokenKind.RightBrace) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read ',' (Seperator) + } + + // Ensure we have a field name + reader.Ensure(TokenKind.String, "Expected field name"); + + var field = ReadField(); + + jsonObject.Add(field.Key, field.Value); + } + + reader.Next(); // Read '}' (Object end) + + return jsonObject; + } + + + // TODO: Use ValueTuple in C#7 + private KeyValuePair ReadField() + { + var fieldName = reader.Current.Value; + + reader.Next(); // Read the field name + + reader.Ensure(TokenKind.Colon, "field"); + + reader.Next(); // Read ':' (Field value indicator) + + return new KeyValuePair(fieldName, ReadFieldValue()); + } + + + internal JsonArray ReadArray() + { + reader.Ensure(TokenKind.LeftBracket, "array"); + + var array = new XNodeArray(); + + reader.Next(); // Read the '[' (Array start) + + // Read the array's items + while (reader.Current.Kind != TokenKind.RightBracket) + { + if (reader.Current.Kind == TokenKind.Comma) + { + reader.Next(); // Read the ',' (Seperator) + } + + if (reader.Current.IsLiteral) + { + array.Add(ReadLiteral()); // Boolean, Date, Number, Null, String, Uri + } + else if (reader.Current.Kind == TokenKind.LeftBracket) + { + array.Add(ReadArray()); // Array + } + else if (reader.Current.Kind == TokenKind.LeftBrace) + { + array.Add(ReadObject()); // Object + } + else + { + throw new ParserException($"Expected comma, literal, or object. Was {reader.Current}."); + } + } + + reader.Next(); // Read the ']' (Array end) + + return array; + } + + #region IDisposable + + public void Dispose() + { + reader.Dispose(); + } + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Parser/JsonToken.cs b/swaggerci/storage/generated/runtime/Parser/JsonToken.cs new file mode 100644 index 000000000000..3a5af4e1e3c9 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Parser/JsonToken.cs @@ -0,0 +1,66 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal enum TokenKind + { + LeftBrace, // { Object start + RightBrace, // } Object end + + LeftBracket, // [ Array start + RightBracket, // ] Array end + + Comma, // , Comma + Colon, // : Value indicator + Dot, // . Access field indicator + Terminator, // \0 Stream terminator + + Boolean = 31, // true or false + Null = 33, // null + Number = 34, // i.e. -1.93, -1, 0, 1, 1.1 + String = 35, // i.e. "text" + + Eof = 50 + } + + internal /* readonly */ struct JsonToken + { + internal static readonly JsonToken BraceOpen = new JsonToken(TokenKind.LeftBrace, "{"); + internal static readonly JsonToken BraceClose = new JsonToken(TokenKind.RightBrace, "}"); + + internal static readonly JsonToken BracketOpen = new JsonToken(TokenKind.LeftBracket, "["); + internal static readonly JsonToken BracketClose = new JsonToken(TokenKind.RightBracket, "]"); + + internal static readonly JsonToken Colon = new JsonToken(TokenKind.Colon, ":"); + internal static readonly JsonToken Comma = new JsonToken(TokenKind.Comma, ","); + internal static readonly JsonToken Terminator = new JsonToken(TokenKind.Terminator, "\0"); + + internal static readonly JsonToken True = new JsonToken(TokenKind.Boolean, "true"); + internal static readonly JsonToken False = new JsonToken(TokenKind.Boolean, "false"); + internal static readonly JsonToken Null = new JsonToken(TokenKind.Null, "null"); + + internal static readonly JsonToken Eof = new JsonToken(TokenKind.Eof, null); + + internal JsonToken(TokenKind kind, string value) + { + Kind = kind; + Value = value; + } + + internal readonly TokenKind Kind; + + internal readonly string Value; + + public override string ToString() => Kind + ": " + Value; + + #region Helpers + + internal bool IsLiteral => (byte)Kind > 30 && (byte)Kind < 40; + + internal bool IsTerminator => Kind == TokenKind.Terminator; + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Parser/JsonTokenizer.cs b/swaggerci/storage/generated/runtime/Parser/JsonTokenizer.cs new file mode 100644 index 000000000000..009211eec2f5 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Parser/JsonTokenizer.cs @@ -0,0 +1,177 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Text; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + using System.IO; + + + public class JsonTokenizer : IDisposable + { + private readonly StringBuilder sb = new StringBuilder(); + + private readonly SourceReader reader; + + internal JsonTokenizer(TextReader reader) + : this(new SourceReader(reader)) { } + + internal JsonTokenizer(SourceReader reader) + { + this.reader = reader; + + reader.Next(); // Start with the first char + } + + internal JsonToken ReadNext() + { + reader.SkipWhitespace(); + + if (reader.IsEof) return JsonToken.Eof; + + switch (reader.Current) + { + case '"': return ReadQuotedString(); + + // Symbols + case '[' : reader.Next(); return JsonToken.BracketOpen; // Array start + case ']' : reader.Next(); return JsonToken.BracketClose; // Array end + case ',' : reader.Next(); return JsonToken.Comma; // Value seperator + case ':' : reader.Next(); return JsonToken.Colon; // Field value indicator + case '{' : reader.Next(); return JsonToken.BraceOpen; // Object start + case '}' : reader.Next(); return JsonToken.BraceClose; // Object end + case '\0' : reader.Next(); return JsonToken.Terminator; // Stream terminiator + + default: return ReadLiteral(); + } + } + + private JsonToken ReadQuotedString() + { + Expect('"', "quoted string indicator"); + + reader.Next(); // Read '"' (Starting quote) + + // Read until we reach an unescaped quote char + while (reader.Current != '"') + { + EnsureNotEof("quoted string"); + + if (reader.Current == '\\') + { + char escapedCharacter = reader.ReadEscapeCode(); + + sb.Append(escapedCharacter); + + continue; + } + + StoreCurrentCharacterAndReadNext(); + } + + reader.Next(); // Read '"' (Ending quote) + + return new JsonToken(TokenKind.String, value: sb.Extract()); + } + + private JsonToken ReadLiteral() + { + if (char.IsDigit(reader.Current) || + reader.Current == '-' || + reader.Current == '+') + { + return ReadNumber(); + } + + return ReadIdentifer(); + } + + private JsonToken ReadNumber() + { + // Read until we hit a non-numeric character + // -6.247737e-06 + // E + + while (char.IsDigit(reader.Current) + || reader.Current == '.' + || reader.Current == 'e' + || reader.Current == 'E' + || reader.Current == '-' + || reader.Current == '+') + { + StoreCurrentCharacterAndReadNext(); + } + + return new JsonToken(TokenKind.Number, value: sb.Extract()); + } + + int count = 0; + + private JsonToken ReadIdentifer() + { + count++; + + if (!char.IsLetter(reader.Current)) + { + throw new ParserException( + message : $"Expected literal (number, boolean, or null). Was '{reader.Current}'.", + location : reader.Location + ); + } + + // Read letters, numbers, and underscores '_' + while (char.IsLetterOrDigit(reader.Current) || reader.Current == '_') + { + StoreCurrentCharacterAndReadNext(); + } + + string text = sb.Extract(); + + switch (text) + { + case "true": return JsonToken.True; + case "false": return JsonToken.False; + case "null": return JsonToken.Null; + + default: return new JsonToken(TokenKind.String, text); + } + } + + private void Expect(char character, string description) + { + if (reader.Current != character) + { + throw new ParserException( + message: $"Expected {description} ('{character}'). Was '{reader.Current}'.", + location: reader.Location + ); + } + } + + private void EnsureNotEof(string tokenType) + { + if (reader.IsEof) + { + throw new ParserException( + message: $"Unexpected EOF while reading {tokenType}.", + location: reader.Location + ); + } + } + + private void StoreCurrentCharacterAndReadNext() + { + sb.Append(reader.Current); + + reader.Next(); + } + + public void Dispose() + { + reader.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Parser/Location.cs b/swaggerci/storage/generated/runtime/Parser/Location.cs new file mode 100644 index 000000000000..390f4bcc59b0 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Parser/Location.cs @@ -0,0 +1,43 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal struct SourceLocation + { + private int line; + private int column; + private int position; + + internal SourceLocation(int line = 0, int column = 0, int position = 0) + { + this.line = line; + this.column = column; + this.position = position; + } + + internal int Line => line; + + internal int Column => column; + + internal int Position => position; + + internal void Advance() + { + this.column++; + this.position++; + } + + internal void MarkNewLine() + { + this.line++; + this.column = 0; + } + + internal SourceLocation Clone() + { + return new SourceLocation(line, column, position); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Parser/Readers/SourceReader.cs b/swaggerci/storage/generated/runtime/Parser/Readers/SourceReader.cs new file mode 100644 index 000000000000..8feaf5fa14ec --- /dev/null +++ b/swaggerci/storage/generated/runtime/Parser/Readers/SourceReader.cs @@ -0,0 +1,130 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Globalization; +using System.IO; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public sealed class SourceReader : IDisposable + { + private readonly TextReader source; + + private char current; + + private readonly SourceLocation location = new SourceLocation(); + + private bool isEof = false; + + internal SourceReader(TextReader textReader) + { + this.source = textReader ?? throw new ArgumentNullException(nameof(textReader)); + } + + /// + /// Advances to the next character + /// + internal void Next() + { + // Advance to the new line when we see a new line '\n'. + // A new line may be prefixed by a carriage return '\r'. + + if (current == '\n') + { + location.MarkNewLine(); + } + + int charCode = source.Read(); // -1 for end + + if (charCode >= 0) + { + current = (char)charCode; + } + else + { + // If we've already marked this as the EOF, throw an exception + if (isEof) + { + throw new EndOfStreamException("Cannot advance past end of stream."); + } + + isEof = true; + + current = '\0'; + } + + location.Advance(); + } + + internal void SkipWhitespace() + { + while (char.IsWhiteSpace(current)) + { + Next(); + } + } + + internal char ReadEscapeCode() + { + Next(); + + char escapedChar = current; + + Next(); // Consume escaped character + + switch (escapedChar) + { + // Special escape codes + case '"': return '"'; // " (Quotation mark) U+0022 + case '/': return '/'; // / (Solidus) U+002F + case '\\': return '\\'; // \ (Reverse solidus) U+005C + + // Control Characters + case '0': return '\0'; // Nul (0) U+0000 + case 'a': return '\a'; // Alert (7) + case 'b': return '\b'; // Backspace (8) U+0008 + case 'f': return '\f'; // Form feed (12) U+000C + case 'n': return '\n'; // Line feed (10) U+000A + case 'r': return '\r'; // Carriage return (13) U+000D + case 't': return '\t'; // Horizontal tab (9) U+0009 + case 'v': return '\v'; // Vertical tab + + // Unicode escape sequence + case 'u': return ReadUnicodeEscapeSequence(); // U+XXXX + + default: throw new Exception($"Unrecognized escape sequence '\\{escapedChar}'"); + } + } + + private readonly char[] hexCode = new char[4]; + + private char ReadUnicodeEscapeSequence() + { + hexCode[0] = current; Next(); + hexCode[1] = current; Next(); + hexCode[2] = current; Next(); + hexCode[3] = current; Next(); + + return Convert.ToChar(int.Parse( + s : new string(hexCode), + style : NumberStyles.HexNumber, + provider: NumberFormatInfo.InvariantInfo + )); + } + + internal char Current => current; + + internal bool IsEof => isEof; + + internal char Peek() => (char)source.Peek(); + + internal SourceLocation Location => location; + + public void Dispose() + { + source.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Parser/TokenReader.cs b/swaggerci/storage/generated/runtime/Parser/TokenReader.cs new file mode 100644 index 000000000000..dca9d95f755b --- /dev/null +++ b/swaggerci/storage/generated/runtime/Parser/TokenReader.cs @@ -0,0 +1,39 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + public class TokenReader : IDisposable + { + private readonly JsonTokenizer tokenizer; + private JsonToken current; + + internal TokenReader(JsonTokenizer tokenizer) + { + this.tokenizer = tokenizer ?? throw new ArgumentNullException(nameof(tokenizer)); + } + + internal void Next() + { + current = tokenizer.ReadNext(); + } + + internal JsonToken Current => current; + + internal void Ensure(TokenKind kind, string readerName) + { + if (current.Kind != kind) + { + throw new ParserException($"Expected {kind} while reading {readerName}). Was {current}."); + } + } + + public void Dispose() + { + tokenizer.Dispose(); + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/PipelineMocking.cs b/swaggerci/storage/generated/runtime/PipelineMocking.cs new file mode 100644 index 000000000000..29ff2d3d3744 --- /dev/null +++ b/swaggerci/storage/generated/runtime/PipelineMocking.cs @@ -0,0 +1,262 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System.Threading.Tasks; + using System.Collections.Generic; + using System.Net.Http; + using System.Linq; + using System.Net; + using Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json; + + public enum MockMode + { + Live, + Record, + Playback, + + } + + public class PipelineMock + { + + private System.Collections.Generic.Stack scenario = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack context = new System.Collections.Generic.Stack(); + private System.Collections.Generic.Stack description = new System.Collections.Generic.Stack(); + + private readonly string recordingPath; + private int counter = 0; + + public static implicit operator Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep(PipelineMock instance) => instance.SendAsync; + + public MockMode Mode { get; set; } = MockMode.Live; + public PipelineMock(string recordingPath) + { + this.recordingPath = recordingPath; + } + + public void PushContext(string text) => context.Push(text); + + public void PushDescription(string text) => description.Push(text); + + + public void PushScenario(string it) + { + // reset counter too + counter = 0; + + scenario.Push(it); + } + + public void PopContext() => context.Pop(); + + public void PopDescription() => description.Pop(); + + public void PopScenario() => scenario.Pop(); + + public void SetRecord() => Mode = MockMode.Record; + + public void SetPlayback() => Mode = MockMode.Playback; + + public void SetLive() => Mode = MockMode.Live; + + public string Scenario => (scenario.Count > 0 ? scenario.Peek() : "[NoScenario]"); + public string Description => (description.Count > 0 ? description.Peek() : "[NoDescription]"); + public string Context => (context.Count > 0 ? context.Peek() : "[NoContext]"); + + /// + /// Headers that we substitute out blank values for in the recordings + /// Add additional headers as necessary + /// + public static HashSet Blacklist = new HashSet(System.StringComparer.CurrentCultureIgnoreCase) { + "Authorization", + }; + + public Dictionary ForceResponseHeaders = new Dictionary(); + + internal static XImmutableArray Removed = new XImmutableArray(new string[] { "[Filtered]" }); + + internal static IEnumerable> FilterHeaders(IEnumerable>> headers) => headers.Select(header => new KeyValuePair(header.Key, Blacklist.Contains(header.Key) ? Removed : new XImmutableArray(header.Value.ToArray()))); + + internal static JsonNode SerializeContent(HttpContent content, ref bool isBase64) => content == null ? XNull.Instance : SerializeContent(content.ReadAsByteArrayAsync().Result, ref isBase64); + + internal static JsonNode SerializeContent(byte[] content, ref bool isBase64) + { + if (null == content || content.Length == 0) + { + return XNull.Instance; + } + var first = content[0]; + var last = content[content.Length - 1]; + + // plaintext for JSON/SGML/XML/HTML/STRINGS/ARRAYS + if ((first == '{' && last == '}') || (first == '<' && last == '>') || (first == '[' && last == ']') || (first == '"' && last == '"')) + { + return new JsonString(System.Text.Encoding.UTF8.GetString(content)); + } + + // base64 for everyone else + return new JsonString(System.Convert.ToBase64String(content)); + } + + internal static byte[] DeserializeContent(string content, bool isBase64) + { + if (string.IsNullOrWhiteSpace(content)) + { + return new byte[0]; + } + + if (isBase64) + { + try + { + return System.Convert.FromBase64String(content); + } + catch + { + // hmm. didn't work, return it as a string I guess. + } + } + return System.Text.Encoding.UTF8.GetBytes(content); + } + + public void SaveMessage(string rqKey, HttpRequestMessage request, HttpResponseMessage response) + { + var messages = System.IO.File.Exists(this.recordingPath) ? Load() : new JsonObject() ?? new JsonObject(); + bool isBase64Request = false; + bool isBase64Response = false; + messages[rqKey] = new JsonObject { + { "Request",new JsonObject { + { "Method", request.Method.Method }, + { "RequestUri", request.RequestUri }, + { "Content", SerializeContent( request.Content, ref isBase64Request) }, + { "isContentBase64", isBase64Request }, + { "Headers", new JsonObject(FilterHeaders(request.Headers)) }, + { "ContentHeaders", request.Content == null ? new JsonObject() : new JsonObject(FilterHeaders(request.Content.Headers))} + } }, + {"Response", new JsonObject { + { "StatusCode", (int)response.StatusCode}, + { "Headers", new JsonObject(FilterHeaders(response.Headers))}, + { "ContentHeaders", new JsonObject(FilterHeaders(response.Content.Headers))}, + { "Content", SerializeContent(response.Content, ref isBase64Response) }, + { "isContentBase64", isBase64Response }, + }} + }; + System.IO.File.WriteAllText(this.recordingPath, messages.ToString()); + } + + private JsonObject Load() + { + if (System.IO.File.Exists(this.recordingPath)) + { + try + { + return JsonObject.FromStream(System.IO.File.OpenRead(this.recordingPath)); + } + catch + { + throw new System.Exception($"Invalid recording file: '{recordingPath}'"); + } + } + + throw new System.ArgumentException($"Missing recording file: '{recordingPath}'", nameof(recordingPath)); + } + + public HttpResponseMessage LoadMessage(string rqKey) + { + var responses = Load(); + var message = responses.Property(rqKey); + + if (null == message) + { + throw new System.ArgumentException($"Missing Request '{rqKey}' in recording file", nameof(rqKey)); + } + + var sc = 0; + var reqMessage = message.Property("Request"); + var respMessage = message.Property("Response"); + + // --------------------------- deserialize response ---------------------------------------------------------------- + bool isBase64Response = false; + respMessage.BooleanProperty("isContentBase64", ref isBase64Response); + var response = new HttpResponseMessage + { + StatusCode = (HttpStatusCode)respMessage.NumberProperty("StatusCode", ref sc), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(respMessage.StringProperty("Content"), isBase64Response)) + }; + + foreach (var each in respMessage.Property("Headers")) + { + response.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + foreach (var frh in ForceResponseHeaders) + { + response.Headers.Remove(frh.Key); + response.Headers.TryAddWithoutValidation(frh.Key, frh.Value); + } + + foreach (var each in respMessage.Property("ContentHeaders")) + { + response.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + // --------------------------- deserialize request ---------------------------------------------------------------- + bool isBase64Request = false; + reqMessage.BooleanProperty("isContentBase64", ref isBase64Request); + response.RequestMessage = new HttpRequestMessage + { + Method = new HttpMethod(reqMessage.StringProperty("Method")), + RequestUri = new System.Uri(reqMessage.StringProperty("RequestUri")), + Content = new System.Net.Http.ByteArrayContent(DeserializeContent(reqMessage.StringProperty("Content"), isBase64Request)) + }; + + foreach (var each in reqMessage.Property("Headers")) + { + response.RequestMessage.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + foreach (var each in reqMessage.Property("ContentHeaders")) + { + response.RequestMessage.Content.Headers.TryAddWithoutValidation(each.Key, each.Value.ToArrayOf()); + } + + return response; + } + + public async Task SendAsync(HttpRequestMessage request, IEventListener callback, ISendAsync next) + { + counter++; + var rqkey = $"{Description}+{Context}+{Scenario}+${request.Method.Method}+{request.RequestUri}+{counter}"; + + switch (Mode) + { + case MockMode.Record: + //Add following code since the request.Content will be released after sendAsync + var requestClone = request; + if (requestClone.Content != null) + { + requestClone = await request.CloneWithContent(request.RequestUri, request.Method); + } + // make the call + var response = await next.SendAsync(request, callback); + + // save the message to the recording file + SaveMessage(rqkey, requestClone, response); + + // return the response. + return response; + + case MockMode.Playback: + // load and return the response. + return LoadMessage(rqkey); + + default: + // pass-thru, do nothing + return await next.SendAsync(request, callback); + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/Properties/Resources.Designer.cs b/swaggerci/storage/generated/runtime/Properties/Resources.Designer.cs new file mode 100644 index 000000000000..ea68650fa391 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Properties/Resources.Designer.cs @@ -0,0 +1,5633 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.generated.runtime.Properties +{ + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + public class Resources + { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() + { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Resources.ResourceManager ResourceManager + { + get + { + if (object.ReferenceEquals(resourceMan, null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.Azure.PowerShell.Cmdlets.Storage.generated.runtime.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + public static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to The remote server returned an error: (401) Unauthorized.. + /// + public static string AccessDeniedExceptionMessage + { + get + { + return ResourceManager.GetString("AccessDeniedExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account id doesn't match one in subscription.. + /// + public static string AccountIdDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("AccountIdDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account needs to be specified. + /// + public static string AccountNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("AccountNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account "{0}" has been added.. + /// + public static string AddAccountAdded + { + get + { + return ResourceManager.GetString("AddAccountAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To switch to a different subscription, please use Select-AzureSubscription.. + /// + public static string AddAccountChangeSubscription + { + get + { + return ResourceManager.GetString("AddAccountChangeSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential".. + /// + public static string AddAccountNonInteractiveGuestOrFpo + { + get + { + return ResourceManager.GetString("AddAccountNonInteractiveGuestOrFpo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription "{0}" is selected as the default subscription.. + /// + public static string AddAccountShowDefaultSubscription + { + get + { + return ResourceManager.GetString("AddAccountShowDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To view all the subscriptions, please use Get-AzureSubscription.. + /// + public static string AddAccountViewSubscriptions + { + get + { + return ResourceManager.GetString("AddAccountViewSubscriptions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is created successfully.. + /// + public static string AddOnCreatedMessage + { + get + { + return ResourceManager.GetString("AddOnCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on name {0} is already used.. + /// + public static string AddOnNameAlreadyUsed + { + get + { + return ResourceManager.GetString("AddOnNameAlreadyUsed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} not found.. + /// + public static string AddOnNotFound + { + get + { + return ResourceManager.GetString("AddOnNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-on {0} is removed successfully.. + /// + public static string AddOnRemovedMessage + { + get + { + return ResourceManager.GetString("AddOnRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-On {0} is updated successfully.. + /// + public static string AddOnUpdatedMessage + { + get + { + return ResourceManager.GetString("AddOnUpdatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}.. + /// + public static string AddRoleMessageCreate + { + get + { + return ResourceManager.GetString("AddRoleMessageCreate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’.. + /// + public static string AddRoleMessageCreateNode + { + get + { + return ResourceManager.GetString("AddRoleMessageCreateNode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure".. + /// + public static string AddRoleMessageCreatePHP + { + get + { + return ResourceManager.GetString("AddRoleMessageCreatePHP", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator. + /// + public static string AddRoleMessageInsufficientPermissions + { + get + { + return ResourceManager.GetString("AddRoleMessageInsufficientPermissions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A role name '{0}' already exists. + /// + public static string AddRoleMessageRoleExists + { + get + { + return ResourceManager.GetString("AddRoleMessageRoleExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} already has an endpoint with name {1}. + /// + public static string AddTrafficManagerEndpointFailed + { + get + { + return ResourceManager.GetString("AddTrafficManagerEndpointFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. + ///Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable [rest of string was truncated]";. + /// + public static string ARMDataCollectionMessage + { + get + { + return ResourceManager.GetString("ARMDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Common.Authentication]: Authenticating for account {0} with single tenant {1}.. + /// + public static string AuthenticatingForSingleTenant + { + get + { + return ResourceManager.GetString("AuthenticatingForSingleTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Windows Azure Powershell\. + /// + public static string AzureDirectory + { + get + { + return ResourceManager.GetString("AzureDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://manage.windowsazure.com. + /// + public static string AzurePortalUrl + { + get + { + return ResourceManager.GetString("AzurePortalUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PORTAL_URL. + /// + public static string AzurePortalUrlEnv + { + get + { + return ResourceManager.GetString("AzurePortalUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Selected profile must not be null.. + /// + public static string AzureProfileMustNotBeNull + { + get + { + return ResourceManager.GetString("AzureProfileMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure SDK\{0}\. + /// + public static string AzureSdkDirectory + { + get + { + return ResourceManager.GetString("AzureSdkDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscArchiveAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscArchiveAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find configuration data file: {0}. + /// + public static string AzureVMDscCannotFindConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscCannotFindConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Create Archive. + /// + public static string AzureVMDscCreateArchiveAction + { + get + { + return ResourceManager.GetString("AzureVMDscCreateArchiveAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The configuration data must be a .psd1 file. + /// + public static string AzureVMDscInvalidConfigurationDataFile + { + get + { + return ResourceManager.GetString("AzureVMDscInvalidConfigurationDataFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Parsing configuration script: {0}. + /// + public static string AzureVMDscParsingConfiguration + { + get + { + return ResourceManager.GetString("AzureVMDscParsingConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it.. + /// + public static string AzureVMDscStorageBlobAlreadyExists + { + get + { + return ResourceManager.GetString("AzureVMDscStorageBlobAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upload '{0}'. + /// + public static string AzureVMDscUploadToBlobStorageAction + { + get + { + return ResourceManager.GetString("AzureVMDscUploadToBlobStorageAction", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Execution failed because a background thread could not prompt the user.. + /// + public static string BaseShouldMethodFailureReason + { + get + { + return ResourceManager.GetString("BaseShouldMethodFailureReason", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Base Uri was empty.. + /// + public static string BaseUriEmpty + { + get + { + return ResourceManager.GetString("BaseUriEmpty", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing without ParameterSet.. + /// + public static string BeginProcessingWithoutParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithoutParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} begin processing with ParameterSet '{1}'.. + /// + public static string BeginProcessingWithParameterSetLog + { + get + { + return ResourceManager.GetString("BeginProcessingWithParameterSetLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Blob with the name {0} already exists in the account.. + /// + public static string BlobAlreadyExistsInTheAccount + { + get + { + return ResourceManager.GetString("BlobAlreadyExistsInTheAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}.blob.core.windows.net/. + /// + public static string BlobEndpointUri + { + get + { + return ResourceManager.GetString("BlobEndpointUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_BLOBSTORAGE_TEMPLATE. + /// + public static string BlobEndpointUriEnv + { + get + { + return ResourceManager.GetString("BlobEndpointUriEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is changing.. + /// + public static string BreakingChangeAttributeParameterChanging + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterChanging", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is becoming mandatory.. + /// + public static string BreakingChangeAttributeParameterMandatoryNow + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterMandatoryNow", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplaced + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplaced", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The parameter : '{0}' is being replaced by mandatory parameter : '{1}'.. + /// + public static string BreakingChangeAttributeParameterReplacedMandatory + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterReplacedMandatory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The type of the parameter is changing from '{0}' to '{1}'.. + /// + public static string BreakingChangeAttributeParameterTypeChange + { + get + { + return ResourceManager.GetString("BreakingChangeAttributeParameterTypeChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Change description : {0} + ///. + /// + public static string BreakingChangesAttributesChangeDescriptionMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesChangeDescriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet is being deprecated. There will be no replacement for it.. + /// + public static string BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesParameterSetDeprecationMessageNoReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet '{0}' is replacing this cmdlet.. + /// + public static string BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetDeprecationMessageWithReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type is changing from the existing type :'{0}' to the new type :'{1}'. + /// + public static string BreakingChangesAttributesCmdLetOutputChange1 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange1", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "The output type '{0}' is changing". + /// + public static string BreakingChangesAttributesCmdLetOutputChange2 + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputChange2", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + ///- The following properties are being added to the output type : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesAdded + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesAdded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to + /// - The following properties in the output type are being deprecated : + ///. + /// + public static string BreakingChangesAttributesCmdLetOutputPropertiesRemoved + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputPropertiesRemoved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The output type '{0}' is being deprecated without a replacement.. + /// + public static string BreakingChangesAttributesCmdLetOutputTypeDeprecated + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesCmdLetOutputTypeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - {0} + /// + ///. + /// + public static string BreakingChangesAttributesDeclarationMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to - Cmdlet : '{0}' + /// - {1} + ///. + /// + public static string BreakingChangesAttributesDeclarationMessageWithCmdletName + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesDeclarationMessageWithCmdletName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to NOTE : Go to {0} for steps to suppress (and other related information on) the breaking change messages.. + /// + public static string BreakingChangesAttributesFooterMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesFooterMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Breaking changes in the cmdlet '{0}' :. + /// + public static string BreakingChangesAttributesHeaderMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesHeaderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note : This change will take effect on '{0}' + ///. + /// + public static string BreakingChangesAttributesInEffectByDateMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByDateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note :The change is expected to take effect from the version : '{0}' + /// + ///. + /// + public static string BreakingChangesAttributesInEffectByVersion + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesInEffectByVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ```powershell + ///# Old + ///{0} + /// + ///# New + ///{1} + ///``` + /// + ///. + /// + public static string BreakingChangesAttributesUsageChangeMessage + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cmdlet invocation changes : + /// Old Way : {0} + /// New Way : {1}. + /// + public static string BreakingChangesAttributesUsageChangeMessageConsole + { + get + { + return ResourceManager.GetString("BreakingChangesAttributesUsageChangeMessageConsole", resourceCulture); + } + } + + /// + /// The cmdlet is in experimental stage. The function may not be enabled in current subscription. + /// + public static string ExperimentalCmdletMessage + { + get + { + return ResourceManager.GetString("ExperimentalCmdletMessage", resourceCulture); + } + } + + + + /// + /// Looks up a localized string similar to CACHERUNTIMEURL. + /// + public static string CacheRuntimeUrl + { + get + { + return ResourceManager.GetString("CacheRuntimeUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cache. + /// + public static string CacheRuntimeValue + { + get + { + return ResourceManager.GetString("CacheRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to CacheRuntimeVersion. + /// + public static string CacheRuntimeVersionKey + { + get + { + return ResourceManager.GetString("CacheRuntimeVersionKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}). + /// + public static string CacheVersionWarningText + { + get + { + return ResourceManager.GetString("CacheVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot change built-in environment {0}.. + /// + public static string CannotChangeBuiltinEnvironment + { + get + { + return ResourceManager.GetString("CannotChangeBuiltinEnvironment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find {0} with name {1}.. + /// + public static string CannotFind + { + get + { + return ResourceManager.GetString("CannotFind", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment for service {0} with {1} slot doesn't exist. + /// + public static string CannotFindDeployment + { + get + { + return ResourceManager.GetString("CannotFindDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Can't find valid Microsoft Azure role in current directory {0}. + /// + public static string CannotFindRole + { + get + { + return ResourceManager.GetString("CannotFindRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist. + /// + public static string CannotFindServiceConfigurationFile + { + get + { + return ResourceManager.GetString("CannotFindServiceConfigurationFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders.. + /// + public static string CannotFindServiceRoot + { + get + { + return ResourceManager.GetString("CannotFindServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated.. + /// + public static string CannotUpdateUnknownSubscription + { + get + { + return ResourceManager.GetString("CannotUpdateUnknownSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ManagementCertificate. + /// + public static string CertificateElementName + { + get + { + return ResourceManager.GetString("CertificateElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to certificate.pfx. + /// + public static string CertificateFileName + { + get + { + return ResourceManager.GetString("CertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate imported into CurrentUser\My\{0}. + /// + public static string CertificateImportedMessage + { + get + { + return ResourceManager.GetString("CertificateImportedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No certificate was found in the certificate store with thumbprint {0}. + /// + public static string CertificateNotFoundInStore + { + get + { + return ResourceManager.GetString("CertificateNotFoundInStore", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your account does not have access to the private key for certificate {0}. + /// + public static string CertificatePrivateKeyAccessError + { + get + { + return ResourceManager.GetString("CertificatePrivateKeyAccessError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} {1} deployment for {2} service. + /// + public static string ChangeDeploymentStateWaitMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStateWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cloud service {0} is in {1} state.. + /// + public static string ChangeDeploymentStatusCompleteMessage + { + get + { + return ResourceManager.GetString("ChangeDeploymentStatusCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing/Removing public environment '{0}' is not allowed.. + /// + public static string ChangePublicEnvironmentMessage + { + get + { + return ResourceManager.GetString("ChangePublicEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} is set to value {1}. + /// + public static string ChangeSettingsElementMessage + { + get + { + return ResourceManager.GetString("ChangeSettingsElementMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Changing public environment is not supported.. + /// + public static string ChangingDefaultEnvironmentNotSupported + { + get + { + return ResourceManager.GetString("ChangingDefaultEnvironmentNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Choose which publish settings file to use:. + /// + public static string ChoosePublishSettingsFile + { + get + { + return ResourceManager.GetString("ChoosePublishSettingsFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel. + /// + public static string ClientDiagnosticLevelName + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string ClientDiagnosticLevelValue + { + get + { + return ResourceManager.GetString("ClientDiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to cloud_package.cspkg. + /// + public static string CloudPackageFileName + { + get + { + return ResourceManager.GetString("CloudPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Cloud.cscfg. + /// + public static string CloudServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("CloudServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Add-ons for {0}. + /// + public static string CloudServiceDescription + { + get + { + return ResourceManager.GetString("CloudServiceDescription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive.. + /// + public static string CommunicationCouldNotBeEstablished + { + get + { + return ResourceManager.GetString("CommunicationCouldNotBeEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete. + /// + public static string CompleteMessage + { + get + { + return ResourceManager.GetString("CompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to OperationID : '{0}'. + /// + public static string ComputeCloudExceptionOperationIdMessage + { + get + { + return ResourceManager.GetString("ComputeCloudExceptionOperationIdMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to config.json. + /// + public static string ConfigurationFileName + { + get + { + return ResourceManager.GetString("ConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to VirtualMachine creation failed.. + /// + public static string CreateFailedErrorMessage + { + get + { + return ResourceManager.GetString("CreateFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead.. + /// + public static string CreateWebsiteFailed + { + get + { + return ResourceManager.GetString("CreateWebsiteFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core. + /// + public static string DataCacheClientsType + { + get + { + return ResourceManager.GetString("DataCacheClientsType", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //blobcontainer[@datacenter='{0}']. + /// + public static string DatacenterBlobQuery + { + get + { + return ResourceManager.GetString("DatacenterBlobQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure PowerShell Data Collection Confirmation. + /// + public static string DataCollectionActivity + { + get + { + return ResourceManager.GetString("DataCollectionActivity", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose not to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmNo + { + get + { + return ResourceManager.GetString("DataCollectionConfirmNo", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This confirmation message will be dismissed in '{0}' second(s).... + /// + public static string DataCollectionConfirmTime + { + get + { + return ResourceManager.GetString("DataCollectionConfirmTime", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You choose to participate in Microsoft Azure PowerShell data collection.. + /// + public static string DataCollectionConfirmYes + { + get + { + return ResourceManager.GetString("DataCollectionConfirmYes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The setting profile has been saved to the following path '{0}'.. + /// + public static string DataCollectionSaveFileInformation + { + get + { + return ResourceManager.GetString("DataCollectionSaveFileInformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription. + /// + public static string DefaultAndCurrentSubscription + { + get + { + return ResourceManager.GetString("DefaultAndCurrentSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to none. + /// + public static string DefaultFileVersion + { + get + { + return ResourceManager.GetString("DefaultFileVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There are no hostnames which could be used for validation.. + /// + public static string DefaultHostnamesValidation + { + get + { + return ResourceManager.GetString("DefaultHostnamesValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 8080. + /// + public static string DefaultPort + { + get + { + return ResourceManager.GetString("DefaultPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string DefaultRoleCachingInMB + { + get + { + return ResourceManager.GetString("DefaultRoleCachingInMB", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Auto. + /// + public static string DefaultUpgradeMode + { + get + { + return ResourceManager.GetString("DefaultUpgradeMode", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 80. + /// + public static string DefaultWebPort + { + get + { + return ResourceManager.GetString("DefaultWebPort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Delete. + /// + public static string Delete + { + get + { + return ResourceManager.GetString("Delete", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for service {1} is already in {2} state. + /// + public static string DeploymentAlreadyInState + { + get + { + return ResourceManager.GetString("DeploymentAlreadyInState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment in {0} slot for service {1} is removed. + /// + public static string DeploymentRemovedMessage + { + get + { + return ResourceManager.GetString("DeploymentRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel. + /// + public static string DiagnosticLevelName + { + get + { + return ResourceManager.GetString("DiagnosticLevelName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1. + /// + public static string DiagnosticLevelValue + { + get + { + return ResourceManager.GetString("DiagnosticLevelValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The key to add already exists in the dictionary.. + /// + public static string DictionaryAddAlreadyContainsKey + { + get + { + return ResourceManager.GetString("DictionaryAddAlreadyContainsKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The array index cannot be less than zero.. + /// + public static string DictionaryCopyToArrayIndexLessThanZero + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayIndexLessThanZero", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The supplied array does not have enough room to contain the copied elements.. + /// + public static string DictionaryCopyToArrayTooShort + { + get + { + return ResourceManager.GetString("DictionaryCopyToArrayTooShort", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided dns {0} doesn't exist. + /// + public static string DnsDoesNotExist + { + get + { + return ResourceManager.GetString("DnsDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft Azure Certificate. + /// + public static string EnableRemoteDesktop_FriendlyCertificateName + { + get + { + return ResourceManager.GetString("EnableRemoteDesktop_FriendlyCertificateName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Endpoint can't be retrieved for storage account. + /// + public static string EndPointNotFoundForBlobStorage + { + get + { + return ResourceManager.GetString("EndPointNotFoundForBlobStorage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} end processing.. + /// + public static string EndProcessingLog + { + get + { + return ResourceManager.GetString("EndProcessingLog", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet.. + /// + public static string EnvironmentDoesNotSupportActiveDirectory + { + get + { + return ResourceManager.GetString("EnvironmentDoesNotSupportActiveDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment '{0}' already exists.. + /// + public static string EnvironmentExists + { + get + { + return ResourceManager.GetString("EnvironmentExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name doesn't match one in subscription.. + /// + public static string EnvironmentNameDoesntMatchSubscription + { + get + { + return ResourceManager.GetString("EnvironmentNameDoesntMatchSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment name needs to be specified.. + /// + public static string EnvironmentNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Environment needs to be specified.. + /// + public static string EnvironmentNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("EnvironmentNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The environment name '{0}' is not found.. + /// + public static string EnvironmentNotFound + { + get + { + return ResourceManager.GetString("EnvironmentNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to environments.xml. + /// + public static string EnvironmentsFileName + { + get + { + return ResourceManager.GetString("EnvironmentsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error creating VirtualMachine. + /// + public static string ErrorCreatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorCreatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to download available runtimes for location '{0}'. + /// + public static string ErrorRetrievingRuntimesForLocation + { + get + { + return ResourceManager.GetString("ErrorRetrievingRuntimesForLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Error updating VirtualMachine. + /// + public static string ErrorUpdatingVirtualMachine + { + get + { + return ResourceManager.GetString("ErrorUpdatingVirtualMachine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} failed. Error: {1}, ExceptionDetails: {2}. + /// + public static string FailedJobErrorMessage + { + get + { + return ResourceManager.GetString("FailedJobErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File path is not valid.. + /// + public static string FilePathIsNotValid + { + get + { + return ResourceManager.GetString("FilePathIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The HTTP request was forbidden with client authentication scheme 'Anonymous'.. + /// + public static string FirstPurchaseErrorMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell.. + /// + public static string FirstPurchaseMessage + { + get + { + return ResourceManager.GetString("FirstPurchaseMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation Status:. + /// + public static string GatewayOperationStatus + { + get + { + return ResourceManager.GetString("GatewayOperationStatus", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\General. + /// + public static string GeneralScaffolding + { + get + { + return ResourceManager.GetString("GeneralScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Getting all available Microsoft Azure Add-Ons, this may take few minutes.... + /// + public static string GetAllAddOnsWaitMessage + { + get + { + return ResourceManager.GetString("GetAllAddOnsWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Name{0}Primary Key{0}Seconday Key. + /// + public static string GetStorageKeysHeader + { + get + { + return ResourceManager.GetString("GetStorageKeysHeader", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Git not found. Please install git and place it in your command line path.. + /// + public static string GitNotFound + { + get + { + return ResourceManager.GetString("GitNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not find publish settings. Please run Import-AzurePublishSettingsFile.. + /// + public static string GlobalSettingsManager_Load_PublishSettingsNotFound + { + get + { + return ResourceManager.GetString("GlobalSettingsManager_Load_PublishSettingsNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg end element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoEndWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoEndWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WadCfg start element in the config is not matching the end element.. + /// + public static string IaasDiagnosticsBadConfigNoMatchingWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoMatchingWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the WadCfg element in the config.. + /// + public static string IaasDiagnosticsBadConfigNoWadCfg + { + get + { + return ResourceManager.GetString("IaasDiagnosticsBadConfigNoWadCfg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode.dll. + /// + public static string IISNodeDll + { + get + { + return ResourceManager.GetString("IISNodeDll", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeEngineKey + { + get + { + return ResourceManager.GetString("IISNodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode-dev\\release\\x64. + /// + public static string IISNodePath + { + get + { + return ResourceManager.GetString("IISNodePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to iisnode. + /// + public static string IISNodeRuntimeValue + { + get + { + return ResourceManager.GetString("IISNodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}). + /// + public static string IISNodeVersionWarningText + { + get + { + return ResourceManager.GetString("IISNodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Illegal characters in path.. + /// + public static string IllegalPath + { + get + { + return ResourceManager.GetString("IllegalPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. + /// + public static string InternalServerErrorMessage + { + get + { + return ResourceManager.GetString("InternalServerErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot enable memcach protocol on a cache worker role {0}.. + /// + public static string InvalidCacheRoleName + { + get + { + return ResourceManager.GetString("InvalidCacheRoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings. + /// + public static string InvalidCertificate + { + get + { + return ResourceManager.GetString("InvalidCertificate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid certificate format.. + /// + public static string InvalidCertificateSingle + { + get + { + return ResourceManager.GetString("InvalidCertificateSingle", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided configuration path is invalid or doesn't exist. + /// + public static string InvalidConfigPath + { + get + { + return ResourceManager.GetString("InvalidConfigPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2.. + /// + public static string InvalidCountryNameMessage + { + get + { + return ResourceManager.GetString("InvalidCountryNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription.. + /// + public static string InvalidDefaultSubscription + { + get + { + return ResourceManager.GetString("InvalidDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deployment with {0} does not exist. + /// + public static string InvalidDeployment + { + get + { + return ResourceManager.GetString("InvalidDeployment", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production".. + /// + public static string InvalidDeploymentSlot + { + get + { + return ResourceManager.GetString("InvalidDeploymentSlot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "{0}" is an invalid DNS name for {1}. + /// + public static string InvalidDnsName + { + get + { + return ResourceManager.GetString("InvalidDnsName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid service endpoint.. + /// + public static string InvalidEndpoint + { + get + { + return ResourceManager.GetString("InvalidEndpoint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided file in {0} must be have {1} extension. + /// + public static string InvalidFileExtension + { + get + { + return ResourceManager.GetString("InvalidFileExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to File {0} has invalid characters. + /// + public static string InvalidFileName + { + get + { + return ResourceManager.GetString("InvalidFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your git publishing credentials using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. On the left side open "Web Sites" + ///2. Click on any website + ///3. Choose "Setup Git Publishing" or "Reset deployment credentials" + ///4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username}. + /// + public static string InvalidGitCredentials + { + get + { + return ResourceManager.GetString("InvalidGitCredentials", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The value {0} provided is not a valid GUID. Please provide a valid GUID.. + /// + public static string InvalidGuid + { + get + { + return ResourceManager.GetString("InvalidGuid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified hostname does not exist. Please specify a valid hostname for the site.. + /// + public static string InvalidHostnameValidation + { + get + { + return ResourceManager.GetString("InvalidHostnameValidation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances must be greater than or equal 0 and less than or equal 20. + /// + public static string InvalidInstancesCount + { + get + { + return ResourceManager.GetString("InvalidInstancesCount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file.. + /// + public static string InvalidJobFile + { + get + { + return ResourceManager.GetString("InvalidJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Could not download a valid runtime manifest, Please check your internet connection and try again.. + /// + public static string InvalidManifestError + { + get + { + return ResourceManager.GetString("InvalidManifestError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The account {0} was not found. Please specify a valid account name.. + /// + public static string InvalidMediaServicesAccount + { + get + { + return ResourceManager.GetString("InvalidMediaServicesAccount", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided name "{0}" does not match the service bus namespace naming rules.. + /// + public static string InvalidNamespaceName + { + get + { + return ResourceManager.GetString("InvalidNamespaceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path must specify a valid path to an Azure profile.. + /// + public static string InvalidNewProfilePath + { + get + { + return ResourceManager.GetString("InvalidNewProfilePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Value cannot be null. Parameter name: '{0}'. + /// + public static string InvalidNullArgument + { + get + { + return ResourceManager.GetString("InvalidNullArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is invalid or empty. + /// + public static string InvalidOrEmptyArgumentMessage + { + get + { + return ResourceManager.GetString("InvalidOrEmptyArgumentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided package path is invalid or doesn't exist. + /// + public static string InvalidPackagePath + { + get + { + return ResourceManager.GetString("InvalidPackagePath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' is an invalid parameter set name.. + /// + public static string InvalidParameterSetName + { + get + { + return ResourceManager.GetString("InvalidParameterSetName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} doesn't exist in {1} or you've not passed valid value for it. + /// + public static string InvalidPath + { + get + { + return ResourceManager.GetString("InvalidPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} has invalid characters. + /// + public static string InvalidPathName + { + get + { + return ResourceManager.GetString("InvalidPathName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token}. + /// + public static string InvalidProfileProperties + { + get + { + return ResourceManager.GetString("InvalidProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile. + /// + public static string InvalidPublishSettingsSchema + { + get + { + return ResourceManager.GetString("InvalidPublishSettingsSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name "{0}" has invalid characters. + /// + public static string InvalidRoleNameMessage + { + get + { + return ResourceManager.GetString("InvalidRoleNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid name for the service root folder is required. + /// + public static string InvalidRootNameMessage + { + get + { + return ResourceManager.GetString("InvalidRootNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} is not a recognized runtime type. + /// + public static string InvalidRuntimeError + { + get + { + return ResourceManager.GetString("InvalidRuntimeError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid language is required. + /// + public static string InvalidScaffoldingLanguageArg + { + get + { + return ResourceManager.GetString("InvalidScaffoldingLanguageArg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscription is currently selected. Use Select-Subscription to activate a subscription.. + /// + public static string InvalidSelectedSubscription + { + get + { + return ResourceManager.GetString("InvalidSelectedSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations.. + /// + public static string InvalidServiceBusLocation + { + get + { + return ResourceManager.GetString("InvalidServiceBusLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide a service name or run this command from inside a service project directory.. + /// + public static string InvalidServiceName + { + get + { + return ResourceManager.GetString("InvalidServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must provide valid value for {0}. + /// + public static string InvalidServiceSettingElement + { + get + { + return ResourceManager.GetString("InvalidServiceSettingElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to settings.json is invalid or doesn't exist. + /// + public static string InvalidServiceSettingMessage + { + get + { + return ResourceManager.GetString("InvalidServiceSettingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data.. + /// + public static string InvalidSubscription + { + get + { + return ResourceManager.GetString("InvalidSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscription id {0} is not valid. + /// + public static string InvalidSubscriptionId + { + get + { + return ResourceManager.GetString("InvalidSubscriptionId", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Must specify a non-null subscription name.. + /// + public static string InvalidSubscriptionName + { + get + { + return ResourceManager.GetString("InvalidSubscriptionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet. + /// + public static string InvalidSubscriptionNameMessage + { + get + { + return ResourceManager.GetString("InvalidSubscriptionNameMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided subscriptions file {0} has invalid content.. + /// + public static string InvalidSubscriptionsDataSchema + { + get + { + return ResourceManager.GetString("InvalidSubscriptionsDataSchema", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge.. + /// + public static string InvalidVMSize + { + get + { + return ResourceManager.GetString("InvalidVMSize", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The web job file must have *.zip extension. + /// + public static string InvalidWebJobFile + { + get + { + return ResourceManager.GetString("InvalidWebJobFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Singleton option works for continuous jobs only.. + /// + public static string InvalidWebJobSingleton + { + get + { + return ResourceManager.GetString("InvalidWebJobSingleton", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The website {0} was not found. Please specify a valid website name.. + /// + public static string InvalidWebsite + { + get + { + return ResourceManager.GetString("InvalidWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No job for id: {0} was found.. + /// + public static string JobNotFound + { + get + { + return ResourceManager.GetString("JobNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to engines. + /// + public static string JsonEnginesSectionName + { + get + { + return ResourceManager.GetString("JsonEnginesSectionName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Scaffolding for this language is not yet supported. + /// + public static string LanguageScaffoldingIsNotSupported + { + get + { + return ResourceManager.GetString("LanguageScaffoldingIsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Link already established. + /// + public static string LinkAlreadyEstablished + { + get + { + return ResourceManager.GetString("LinkAlreadyEstablished", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to local_package.csx. + /// + public static string LocalPackageFileName + { + get + { + return ResourceManager.GetString("LocalPackageFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceConfiguration.Local.cscfg. + /// + public static string LocalServiceConfigurationFileName + { + get + { + return ResourceManager.GetString("LocalServiceConfigurationFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for {0} deployment for {1} cloud service.... + /// + public static string LookingForDeploymentMessage + { + get + { + return ResourceManager.GetString("LookingForDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Looking for cloud service {0}.... + /// + public static string LookingForServiceMessage + { + get + { + return ResourceManager.GetString("LookingForServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure Long-Running Job. + /// + public static string LROJobName + { + get + { + return ResourceManager.GetString("LROJobName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter.. + /// + public static string LROTaskExceptionMessage + { + get + { + return ResourceManager.GetString("LROTaskExceptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to managementCertificate.pem. + /// + public static string ManagementCertificateFileName + { + get + { + return ResourceManager.GetString("ManagementCertificateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ?whr={0}. + /// + public static string ManagementPortalRealmFormat + { + get + { + return ResourceManager.GetString("ManagementPortalRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to //baseuri. + /// + public static string ManifestBaseUriQuery + { + get + { + return ResourceManager.GetString("ManifestBaseUriQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to uri. + /// + public static string ManifestBlobUriKey + { + get + { + return ResourceManager.GetString("ManifestBlobUriKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml. + /// + public static string ManifestUri + { + get + { + return ResourceManager.GetString("ManifestUri", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'.. + /// + public static string MissingCertificateInProfileProperties + { + get + { + return ResourceManager.GetString("MissingCertificateInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'.. + /// + public static string MissingPasswordInProfileProperties + { + get + { + return ResourceManager.GetString("MissingPasswordInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Property bag Hashtable must contain a 'SubscriptionId'.. + /// + public static string MissingSubscriptionInProfileProperties + { + get + { + return ResourceManager.GetString("MissingSubscriptionInProfileProperties", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple Add-Ons found holding name {0}. + /// + public static string MultipleAddOnsFoundMessage + { + get + { + return ResourceManager.GetString("MultipleAddOnsFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername.. + /// + public static string MultiplePublishingUsernames + { + get + { + return ResourceManager.GetString("MultiplePublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The first publish settings file "{0}" is used. If you want to use another file specify the file name.. + /// + public static string MultiplePublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("MultiplePublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Plugins.Caching.NamedCaches. + /// + public static string NamedCacheSettingName + { + get + { + return ResourceManager.GetString("NamedCacheSettingName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]}. + /// + public static string NamedCacheSettingValue + { + get + { + return ResourceManager.GetString("NamedCacheSettingValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A publishing username is required. Please specify one using the argument PublishingUsername.. + /// + public static string NeedPublishingUsernames + { + get + { + return ResourceManager.GetString("NeedPublishingUsernames", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to New Add-On Confirmation. + /// + public static string NewAddOnConformation + { + get + { + return ResourceManager.GetString("NewAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string NewMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names.. + /// + public static string NewNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("NewNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at {0} and (c) agree to sharing my contact information with {2}.. + /// + public static string NewNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("NewNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service has been created at {0}. + /// + public static string NewServiceCreatedMessage + { + get + { + return ResourceManager.GetString("NewServiceCreatedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No. + /// + public static string No + { + get + { + return ResourceManager.GetString("No", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription.. + /// + public static string NoCachedToken + { + get + { + return ResourceManager.GetString("NoCachedToken", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole.. + /// + public static string NoCacheWorkerRoles + { + get + { + return ResourceManager.GetString("NoCacheWorkerRoles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No clouds available. + /// + public static string NoCloudsAvailable + { + get + { + return ResourceManager.GetString("NoCloudsAvailable", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "There is no current context, please log in using Connect-AzAccount.". + /// + public static string NoCurrentContextForDataCmdlet + { + get + { + return ResourceManager.GetString("NoCurrentContextForDataCmdlet", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeDirectory + { + get + { + return ResourceManager.GetString("NodeDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeEngineKey + { + get + { + return ResourceManager.GetString("NodeEngineKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node.exe. + /// + public static string NodeExe + { + get + { + return ResourceManager.GetString("NodeExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name>. + /// + public static string NoDefaultSubscriptionMessage + { + get + { + return ResourceManager.GetString("NoDefaultSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft SDKs\Azure\Nodejs\Nov2011. + /// + public static string NodeModulesPath + { + get + { + return ResourceManager.GetString("NodeModulesPath", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to nodejs. + /// + public static string NodeProgramFilesFolderName + { + get + { + return ResourceManager.GetString("NodeProgramFilesFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to node. + /// + public static string NodeRuntimeValue + { + get + { + return ResourceManager.GetString("NodeRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\Node. + /// + public static string NodeScaffolding + { + get + { + return ResourceManager.GetString("NodeScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node. + /// + public static string NodeScaffoldingResources + { + get + { + return ResourceManager.GetString("NodeScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}). + /// + public static string NodeVersionWarningText + { + get + { + return ResourceManager.GetString("NodeVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No, I do not agree. + /// + public static string NoHint + { + get + { + return ResourceManager.GetString("NoHint", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please connect to internet before executing this cmdlet. + /// + public static string NoInternetConnection + { + get + { + return ResourceManager.GetString("NoInternetConnection", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to <NONE>. + /// + public static string None + { + get + { + return ResourceManager.GetString("None", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No publish settings files with extension *.publishsettings are found in the directory "{0}".. + /// + public static string NoPublishSettingsFilesFoundMessage + { + get + { + return ResourceManager.GetString("NoPublishSettingsFilesFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to There is no subscription associated with account {0}.. + /// + public static string NoSubscriptionAddedMessage + { + get + { + return ResourceManager.GetString("NoSubscriptionAddedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount?. + /// + public static string NoSubscriptionFoundForTenant + { + get + { + return ResourceManager.GetString("NoSubscriptionFoundForTenant", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration.. + /// + public static string NotCacheWorkerRole + { + get + { + return ResourceManager.GetString("NotCacheWorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Certificate can't be null.. + /// + public static string NullCertificateMessage + { + get + { + return ResourceManager.GetString("NullCertificateMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} could not be null or empty. + /// + public static string NullObjectMessage + { + get + { + return ResourceManager.GetString("NullObjectMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add a null RoleSettings to {0}. + /// + public static string NullRoleSettingsMessage + { + get + { + return ResourceManager.GetString("NullRoleSettingsMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to add new role to null service definition. + /// + public static string NullServiceDefinitionMessage + { + get + { + return ResourceManager.GetString("NullServiceDefinitionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The request offer '{0}' is not found.. + /// + public static string OfferNotFoundMessage + { + get + { + return ResourceManager.GetString("OfferNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Operation "{0}" failed on VM with ID: {1}. + /// + public static string OperationFailedErrorMessage + { + get + { + return ResourceManager.GetString("OperationFailedErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The REST operation failed with message '{0}' and error code '{1}'. + /// + public static string OperationFailedMessage + { + get + { + return ResourceManager.GetString("OperationFailedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state.. + /// + public static string OperationTimedOutOrError + { + get + { + return ResourceManager.GetString("OperationTimedOutOrError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package. + /// + public static string Package + { + get + { + return ResourceManager.GetString("Package", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Package is created at service root path {0}.. + /// + public static string PackageCreated + { + get + { + return ResourceManager.GetString("PackageCreated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {{ + /// "author": "", + /// + /// "name": "{0}", + /// "version": "0.0.0", + /// "dependencies":{{}}, + /// "devDependencies":{{}}, + /// "optionalDependencies": {{}}, + /// "engines": {{ + /// "node": "*", + /// "iisnode": "*" + /// }} + /// + ///}} + ///. + /// + public static string PackageJsonDefaultFile + { + get + { + return ResourceManager.GetString("PackageJsonDefaultFile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to package.json. + /// + public static string PackageJsonFileName + { + get + { + return ResourceManager.GetString("PackageJsonFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path {0} doesn't exist.. + /// + public static string PathDoesNotExist + { + get + { + return ResourceManager.GetString("PathDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path for {0} doesn't exist in {1}.. + /// + public static string PathDoesNotExistForElement + { + get + { + return ResourceManager.GetString("PathDoesNotExistForElement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Peer Asn has to be provided.. + /// + public static string PeerAsnRequired + { + get + { + return ResourceManager.GetString("PeerAsnRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 5.4.0. + /// + public static string PHPDefaultRuntimeVersion + { + get + { + return ResourceManager.GetString("PHPDefaultRuntimeVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to php. + /// + public static string PhpRuntimeValue + { + get + { + return ResourceManager.GetString("PhpRuntimeValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resources\Scaffolding\PHP. + /// + public static string PHPScaffolding + { + get + { + return ResourceManager.GetString("PHPScaffolding", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP. + /// + public static string PHPScaffoldingResources + { + get + { + return ResourceManager.GetString("PHPScaffoldingResources", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}). + /// + public static string PHPVersionWarningText + { + get + { + return ResourceManager.GetString("PHPVersionWarningText", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to You must create your first web site using the Microsoft Azure portal. + ///Please follow these steps in the portal: + ///1. At the bottom of the page, click on New > Web Site > Quick Create + ///2. Type {0} in the URL field + ///3. Click on "Create Web Site" + ///4. Once the site has been created, click on the site name + ///5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create.. + /// + public static string PortalInstructions + { + get + { + return ResourceManager.GetString("PortalInstructions", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git". + /// + public static string PortalInstructionsGit + { + get + { + return ResourceManager.GetString("PortalInstructionsGit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to This cmdlet is in preview. The functionality may not be available in the selected subscription. + /// + public static string PreviewCmdletMessage + { + get + { + return ResourceManager.GetString("PreviewCmdletMessage", resourceCulture); + } + } + + + /// + /// Looks up a localized string similar to A value for the Primary Peer Subnet has to be provided.. + /// + public static string PrimaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("PrimaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Promotion code can be used only when updating to a new plan.. + /// + public static string PromotionCodeWithCurrentPlanMessage + { + get + { + return ResourceManager.GetString("PromotionCodeWithCurrentPlanMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service not published at user request.. + /// + public static string PublishAbortedAtUserRequest + { + get + { + return ResourceManager.GetString("PublishAbortedAtUserRequest", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Complete.. + /// + public static string PublishCompleteMessage + { + get + { + return ResourceManager.GetString("PublishCompleteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Connecting.... + /// + public static string PublishConnectingMessage + { + get + { + return ResourceManager.GetString("PublishConnectingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Deployment ID: {0}.. + /// + public static string PublishCreatedDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishCreatedDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created hosted service '{0}'.. + /// + public static string PublishCreatedServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatedServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Created Website URL: {0}.. + /// + public static string PublishCreatedWebsiteMessage + { + get + { + return ResourceManager.GetString("PublishCreatedWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Creating.... + /// + public static string PublishCreatingServiceMessage + { + get + { + return ResourceManager.GetString("PublishCreatingServiceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Initializing.... + /// + public static string PublishInitializingMessage + { + get + { + return ResourceManager.GetString("PublishInitializingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to busy. + /// + public static string PublishInstanceStatusBusy + { + get + { + return ResourceManager.GetString("PublishInstanceStatusBusy", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to creating the virtual machine. + /// + public static string PublishInstanceStatusCreating + { + get + { + return ResourceManager.GetString("PublishInstanceStatusCreating", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Instance {0} of role {1} is {2}.. + /// + public static string PublishInstanceStatusMessage + { + get + { + return ResourceManager.GetString("PublishInstanceStatusMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ready. + /// + public static string PublishInstanceStatusReady + { + get + { + return ResourceManager.GetString("PublishInstanceStatusReady", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing deployment for {0} with Subscription ID: {1}.... + /// + public static string PublishPreparingDeploymentMessage + { + get + { + return ResourceManager.GetString("PublishPreparingDeploymentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publishing {0} to Microsoft Azure. This may take several minutes.... + /// + public static string PublishServiceStartMessage + { + get + { + return ResourceManager.GetString("PublishServiceStartMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publish settings. + /// + public static string PublishSettings + { + get + { + return ResourceManager.GetString("PublishSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure. + /// + public static string PublishSettingsElementName + { + get + { + return ResourceManager.GetString("PublishSettingsElementName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to .PublishSettings. + /// + public static string PublishSettingsFileExtention + { + get + { + return ResourceManager.GetString("PublishSettingsFileExtention", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to publishSettings.xml. + /// + public static string PublishSettingsFileName + { + get + { + return ResourceManager.GetString("PublishSettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to &whr={0}. + /// + public static string PublishSettingsFileRealmFormat + { + get + { + return ResourceManager.GetString("PublishSettingsFileRealmFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Publish settings imported. + /// + public static string PublishSettingsSetSuccessfully + { + get + { + return ResourceManager.GetString("PublishSettingsSetSuccessfully", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AZURE_PUBLISHINGPROFILE_URL. + /// + public static string PublishSettingsUrlEnv + { + get + { + return ResourceManager.GetString("PublishSettingsUrlEnv", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting.... + /// + public static string PublishStartingMessage + { + get + { + return ResourceManager.GetString("PublishStartingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Upgrading.... + /// + public static string PublishUpgradingMessage + { + get + { + return ResourceManager.GetString("PublishUpgradingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Uploading Package to storage service {0}.... + /// + public static string PublishUploadingPackageMessage + { + get + { + return ResourceManager.GetString("PublishUploadingPackageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Verifying storage account '{0}'.... + /// + public static string PublishVerifyingStorageMessage + { + get + { + return ResourceManager.GetString("PublishVerifyingStorageMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionAdditionalContentPathNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionAdditionalContentPathNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration published to {0}. + /// + public static string PublishVMDscExtensionArchiveUploadedMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionArchiveUploadedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyFileVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyFileVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Copy the module '{0}' to '{1}'.. + /// + public static string PublishVMDscExtensionCopyModuleVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCopyModuleVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1).. + /// + public static string PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionCreateArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleted '{0}'. + /// + public static string PublishVMDscExtensionDeletedFileMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeletedFileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot delete '{0}': {1}. + /// + public static string PublishVMDscExtensionDeleteErrorMessage + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDeleteErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Path '{0}' not found.. + /// + public static string PublishVMDscExtensionDirectoryNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionDirectoryNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot get module for DscResource '{0}'. Possible solutions: + ///1) Specify -ModuleName for Import-DscResource in your configuration. + ///2) Unblock module that contains resource. + ///3) Move Import-DscResource inside Node block. + ///. + /// + public static string PublishVMDscExtensionGetDscResourceFailed + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionGetDscResourceFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to List of required modules: [{0}].. + /// + public static string PublishVMDscExtensionRequiredModulesVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredModulesVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version.. + /// + public static string PublishVMDscExtensionRequiredPsVersion + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionRequiredPsVersion", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration script '{0}' contained parse errors: + ///{1}. + /// + public static string PublishVMDscExtensionStorageParserErrors + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionStorageParserErrors", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Temp folder '{0}' created.. + /// + public static string PublishVMDscExtensionTempFolderVerbose + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionTempFolderVerbose", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid configuration file: {0}. + ///The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip).. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileInvalidExtension", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Configuration file '{0}' not found.. + /// + public static string PublishVMDscExtensionUploadArchiveConfigFileNotExist + { + get + { + return ResourceManager.GetString("PublishVMDscExtensionUploadArchiveConfigFileNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Azure PowerShell collects usage data in order to improve your experience. + ///The data is anonymous and does not include commandline argument values. + ///The data is collected by Microsoft. + /// + ///Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. + ///Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enab [rest of string was truncated]";. + /// + public static string RDFEDataCollectionMessage + { + get + { + return ResourceManager.GetString("RDFEDataCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Replace current deployment with '{0}' Id ?. + /// + public static string RedeployCommit + { + get + { + return ResourceManager.GetString("RedeployCommit", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to regenerate key?. + /// + public static string RegenerateKeyWarning + { + get + { + return ResourceManager.GetString("RegenerateKeyWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Generate new key.. + /// + public static string RegenerateKeyWhatIfMessage + { + get + { + return ResourceManager.GetString("RegenerateKeyWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove account '{0}'?. + /// + public static string RemoveAccountConfirmation + { + get + { + return ResourceManager.GetString("RemoveAccountConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing account. + /// + public static string RemoveAccountMessage + { + get + { + return ResourceManager.GetString("RemoveAccountMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove Add-On Confirmation. + /// + public static string RemoveAddOnConformation + { + get + { + return ResourceManager.GetString("RemoveAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm.. + /// + public static string RemoveAddOnMessage + { + get + { + return ResourceManager.GetString("RemoveAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureBGPPeering Operation failed.. + /// + public static string RemoveAzureBGPPeeringFailed + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Bgp Peering. + /// + public static string RemoveAzureBGPPeeringMessage + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Bgp Peering with Service Key {0}.. + /// + public static string RemoveAzureBGPPeeringSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Bgp Peering with service key '{0}'?. + /// + public static string RemoveAzureBGPPeeringWarning + { + get + { + return ResourceManager.GetString("RemoveAzureBGPPeeringWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit with service key '{0}'?. + /// + public static string RemoveAzureDedicatdCircuitWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatdCircuitWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuit Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureDedicatedCircuitLink Operation failed.. + /// + public static string RemoveAzureDedicatedCircuitLinkFailed + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circui Link. + /// + public static string RemoveAzureDedicatedCircuitLinkMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1}. + /// + public static string RemoveAzureDedicatedCircuitLinkSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'?. + /// + public static string RemoveAzureDedicatedCircuitLinkWarning + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitLinkWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing Dedicated Circuit. + /// + public static string RemoveAzureDedicatedCircuitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Azure Dedicated Circuit with Service Key {0}.. + /// + public static string RemoveAzureDedicatedCircuitSucceeded + { + get + { + return ResourceManager.GetString("RemoveAzureDedicatedCircuitSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing cloud service {0}.... + /// + public static string RemoveAzureServiceWaitMessage + { + get + { + return ResourceManager.GetString("RemoveAzureServiceWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription.. + /// + public static string RemoveDefaultSubscription + { + get + { + return ResourceManager.GetString("RemoveDefaultSubscription", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing {0} deployment for {1} service. + /// + public static string RemoveDeploymentWaitMessage + { + get + { + return ResourceManager.GetString("RemoveDeploymentWaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'?. + /// + public static string RemoveEnvironmentConfirmation + { + get + { + return ResourceManager.GetString("RemoveEnvironmentConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing environment. + /// + public static string RemoveEnvironmentMessage + { + get + { + return ResourceManager.GetString("RemoveEnvironmentMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job collection. + /// + public static string RemoveJobCollectionMessage + { + get + { + return ResourceManager.GetString("RemoveJobCollectionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job collection "{0}". + /// + public static string RemoveJobCollectionWarning + { + get + { + return ResourceManager.GetString("RemoveJobCollectionWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing job. + /// + public static string RemoveJobMessage + { + get + { + return ResourceManager.GetString("RemoveJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the job "{0}". + /// + public static string RemoveJobWarning + { + get + { + return ResourceManager.GetString("RemoveJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the account?. + /// + public static string RemoveMediaAccountWarning + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account removed.. + /// + public static string RemoveMediaAccountWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveMediaAccountWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription.. + /// + public static string RemoveNamespaceErrorMessage + { + get + { + return ResourceManager.GetString("RemoveNamespaceErrorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing old package {0}.... + /// + public static string RemovePackage + { + get + { + return ResourceManager.GetString("RemovePackage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile?. + /// + public static string RemoveProfileConfirmation + { + get + { + return ResourceManager.GetString("RemoveProfileConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing the Azure profile. + /// + public static string RemoveProfileMessage + { + get + { + return ResourceManager.GetString("RemoveProfileMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the namespace '{0}'?. + /// + public static string RemoveServiceBusNamespaceConfirmation + { + get + { + return ResourceManager.GetString("RemoveServiceBusNamespaceConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove cloud service?. + /// + public static string RemoveServiceWarning + { + get + { + return ResourceManager.GetString("RemoveServiceWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove cloud service and all it's deployments. + /// + public static string RemoveServiceWhatIfMessage + { + get + { + return ResourceManager.GetString("RemoveServiceWhatIfMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove subscription '{0}'?. + /// + public static string RemoveSubscriptionConfirmation + { + get + { + return ResourceManager.GetString("RemoveSubscriptionConfirmation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing subscription. + /// + public static string RemoveSubscriptionMessage + { + get + { + return ResourceManager.GetString("RemoveSubscriptionMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The endpoint {0} cannot be removed from profile {1} because it's not in the profile.. + /// + public static string RemoveTrafficManagerEndpointMissing + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerEndpointMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Remove-AzureTrafficManagerProfile Operation failed.. + /// + public static string RemoveTrafficManagerProfileFailed + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileFailed", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Successfully removed Traffic Manager profile with name {0}.. + /// + public static string RemoveTrafficManagerProfileSucceeded + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileSucceeded", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the Traffic Manager profile "{0}"?. + /// + public static string RemoveTrafficManagerProfileWarning + { + get + { + return ResourceManager.GetString("RemoveTrafficManagerProfileWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to delete the VM '{0}'?. + /// + public static string RemoveVMConfirmationMessage + { + get + { + return ResourceManager.GetString("RemoveVMConfirmationMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting VM.. + /// + public static string RemoveVMMessage + { + get + { + return ResourceManager.GetString("RemoveVMMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing WebJob.... + /// + public static string RemoveWebJobMessage + { + get + { + return ResourceManager.GetString("RemoveWebJobMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove job '{0}'?. + /// + public static string RemoveWebJobWarning + { + get + { + return ResourceManager.GetString("RemoveWebJobWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing website. + /// + public static string RemoveWebsiteMessage + { + get + { + return ResourceManager.GetString("RemoveWebsiteMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to remove the website "{0}". + /// + public static string RemoveWebsiteWarning + { + get + { + return ResourceManager.GetString("RemoveWebsiteWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Removing public environment is not supported.. + /// + public static string RemovingDefaultEnvironmentsNotSupported + { + get + { + return ResourceManager.GetString("RemovingDefaultEnvironmentsNotSupported", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Deleting namespace. + /// + public static string RemovingNamespaceMessage + { + get + { + return ResourceManager.GetString("RemovingNamespaceMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Repository is not setup. You need to pass a valid site name.. + /// + public static string RepositoryNotSetup + { + get + { + return ResourceManager.GetString("RepositoryNotSetup", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use.. + /// + public static string ReservedIPNameNoLongerInUseButStillBeingReserved + { + get + { + return ResourceManager.GetString("ReservedIPNameNoLongerInUseButStillBeingReserved", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resource with ID : {0} does not exist.. + /// + public static string ResourceNotFound + { + get + { + return ResourceManager.GetString("ResourceNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Restart. + /// + public static string Restart + { + get + { + return ResourceManager.GetString("Restart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Resume. + /// + public static string Resume + { + get + { + return ResourceManager.GetString("Resume", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /role:{0};"{1}/{0}" . + /// + public static string RoleArgTemplate + { + get + { + return ResourceManager.GetString("RoleArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to bin. + /// + public static string RoleBinFolderName + { + get + { + return ResourceManager.GetString("RoleBinFolderName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} is {1}. + /// + public static string RoleInstanceWaitMsg + { + get + { + return ResourceManager.GetString("RoleInstanceWaitMsg", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 20. + /// + public static string RoleMaxInstances + { + get + { + return ResourceManager.GetString("RoleMaxInstances", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to role name. + /// + public static string RoleName + { + get + { + return ResourceManager.GetString("RoleName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided role name {0} doesn't exist. + /// + public static string RoleNotFoundMessage + { + get + { + return ResourceManager.GetString("RoleNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RoleSettings.xml. + /// + public static string RoleSettingsTemplateFileName + { + get + { + return ResourceManager.GetString("RoleSettingsTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role type {0} doesn't exist. + /// + public static string RoleTypeDoesNotExist + { + get + { + return ResourceManager.GetString("RoleTypeDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to public static Dictionary<string, Location> ReverseLocations { get; private set; }. + /// + public static string RuntimeDeploymentLocationError + { + get + { + return ResourceManager.GetString("RuntimeDeploymentLocationError", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Preparing runtime deployment for service '{0}'. + /// + public static string RuntimeDeploymentStart + { + get + { + return ResourceManager.GetString("RuntimeDeploymentStart", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version?. + /// + public static string RuntimeMismatchWarning + { + get + { + return ResourceManager.GetString("RuntimeMismatchWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEOVERRIDEURL. + /// + public static string RuntimeOverrideKey + { + get + { + return ResourceManager.GetString("RuntimeOverrideKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /runtimemanifest/runtimes/runtime. + /// + public static string RuntimeQuery + { + get + { + return ResourceManager.GetString("RuntimeQuery", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEID. + /// + public static string RuntimeTypeKey + { + get + { + return ResourceManager.GetString("RuntimeTypeKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEURL. + /// + public static string RuntimeUrlKey + { + get + { + return ResourceManager.GetString("RuntimeUrlKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to RUNTIMEVERSIONPRIMARYKEY. + /// + public static string RuntimeVersionPrimaryKey + { + get + { + return ResourceManager.GetString("RuntimeVersionPrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to scaffold.xml. + /// + public static string ScaffoldXml + { + get + { + return ResourceManager.GetString("ScaffoldXml", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation. + /// + public static string SchedulerInvalidLocation + { + get + { + return ResourceManager.GetString("SchedulerInvalidLocation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the Secondary Peer Subnet has to be provided.. + /// + public static string SecondaryPeerSubnetRequired + { + get + { + return ResourceManager.GetString("SecondaryPeerSubnetRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} already exists on disk in location {1}. + /// + public static string ServiceAlreadyExistsOnDisk + { + get + { + return ResourceManager.GetString("ServiceAlreadyExistsOnDisk", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to No ServiceBus authorization rule with the given characteristics was found. + /// + public static string ServiceBusAuthorizationRuleNotFound + { + get + { + return ResourceManager.GetString("ServiceBusAuthorizationRuleNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The service bus entity '{0}' is not found.. + /// + public static string ServiceBusEntityTypeNotFound + { + get + { + return ResourceManager.GetString("ServiceBusEntityTypeNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Internal Server Error. This could happen due to an incorrect/missing namespace. + /// + public static string ServiceBusNamespaceMissingMessage + { + get + { + return ResourceManager.GetString("ServiceBusNamespaceMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service configuration. + /// + public static string ServiceConfiguration + { + get + { + return ResourceManager.GetString("ServiceConfiguration", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service definition. + /// + public static string ServiceDefinition + { + get + { + return ResourceManager.GetString("ServiceDefinition", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to ServiceDefinition.csdef. + /// + public static string ServiceDefinitionFileName + { + get + { + return ResourceManager.GetString("ServiceDefinitionFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0}Deploy. + /// + public static string ServiceDeploymentName + { + get + { + return ResourceManager.GetString("ServiceDeploymentName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The specified cloud service "{0}" does not exist.. + /// + public static string ServiceDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is in {2} state, please wait until it finish and update it's status. + /// + public static string ServiceIsInTransitionState + { + get + { + return ResourceManager.GetString("ServiceIsInTransitionState", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}.". + /// + public static string ServiceManagementClientExceptionStringFormat + { + get + { + return ResourceManager.GetString("ServiceManagementClientExceptionStringFormat", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Begin Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSBeginOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSBeginOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Completed Operation: {0}. + /// + public static string ServiceManagementExecuteClientActionInOCSCompletedOperation + { + get + { + return ResourceManager.GetString("ServiceManagementExecuteClientActionInOCSCompletedOperation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service name. + /// + public static string ServiceName + { + get + { + return ResourceManager.GetString("ServiceName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provided service name {0} already exists, please pick another name. + /// + public static string ServiceNameExists + { + get + { + return ResourceManager.GetString("ServiceNameExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please provide name for the hosted service. + /// + public static string ServiceNameMissingMessage + { + get + { + return ResourceManager.GetString("ServiceNameMissingMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service parent directory. + /// + public static string ServiceParentDirectory + { + get + { + return ResourceManager.GetString("ServiceParentDirectory", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Service {0} removed successfully. + /// + public static string ServiceRemovedMessage + { + get + { + return ResourceManager.GetString("ServiceRemovedMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service directory. + /// + public static string ServiceRoot + { + get + { + return ResourceManager.GetString("ServiceRoot", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to service settings. + /// + public static string ServiceSettings + { + get + { + return ResourceManager.GetString("ServiceSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.. + /// + public static string ServiceSettings_ValidateStorageAccountName_InvalidName + { + get + { + return ResourceManager.GetString("ServiceSettings_ValidateStorageAccountName_InvalidName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The {0} slot for cloud service {1} doesn't exist.. + /// + public static string ServiceSlotDoesNotExist + { + get + { + return ResourceManager.GetString("ServiceSlotDoesNotExist", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {0} slot for service {1} is {2}. + /// + public static string ServiceStatusChanged + { + get + { + return ResourceManager.GetString("ServiceStatusChanged", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Set Add-On Confirmation. + /// + public static string SetAddOnConformation + { + get + { + return ResourceManager.GetString("SetAddOnConformation", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Profile {0} does not contain endpoint {1}. Adding it.. + /// + public static string SetInexistentTrafficManagerEndpointMessage + { + get + { + return ResourceManager.GetString("SetInexistentTrafficManagerEndpointMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my + ///contact information with {2}.. + /// + public static string SetMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Note - You will be charged the amount for the new plan, without being refunded for time remaining + ///in the existing plan. + ///By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis + ///for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) + ///acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of + ///use and privacy statement at <url> and (c) agree to sharing my contact information with {2}.. + /// + public static string SetNonMicrosoftAddOnMessage + { + get + { + return ResourceManager.GetString("SetNonMicrosoftAddOnMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Role {0} instances are set to {1}. + /// + public static string SetRoleInstancesMessage + { + get + { + return ResourceManager.GetString("SetRoleInstancesMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to {"Slot":"","Location":"","Subscription":"","StorageAccountName":""}. + /// + public static string SettingsFileEmptyContent + { + get + { + return ResourceManager.GetString("SettingsFileEmptyContent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to deploymentSettings.json. + /// + public static string SettingsFileName + { + get + { + return ResourceManager.GetString("SettingsFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Insufficient parameters passed to create a new endpoint.. + /// + public static string SetTrafficManagerEndpointNeedsParameters + { + get + { + return ResourceManager.GetString("SetTrafficManagerEndpointNeedsParameters", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Ambiguous operation: the profile name specified doesn't match the name of the profile object.. + /// + public static string SetTrafficManagerProfileAmbiguous + { + get + { + return ResourceManager.GetString("SetTrafficManagerProfileAmbiguous", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts.. + /// + public static string ShouldContinueFail + { + get + { + return ResourceManager.GetString("ShouldContinueFail", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Confirm. + /// + public static string ShouldProcessCaption + { + get + { + return ResourceManager.GetString("ShouldProcessCaption", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailConfirm + { + get + { + return ResourceManager.GetString("ShouldProcessFailConfirm", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again.. + /// + public static string ShouldProcessFailImpact + { + get + { + return ResourceManager.GetString("ShouldProcessFailImpact", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter.. + /// + public static string ShouldProcessFailWhatIf + { + get + { + return ResourceManager.GetString("ShouldProcessFailWhatIf", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Shutdown. + /// + public static string Shutdown + { + get + { + return ResourceManager.GetString("Shutdown", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to /sites:{0};{1};"{2}/{0}" . + /// + public static string SitesArgTemplate + { + get + { + return ResourceManager.GetString("SitesArgTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to 1000. + /// + public static string StandardRetryDelayInMs + { + get + { + return ResourceManager.GetString("StandardRetryDelayInMs", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Start. + /// + public static string Start + { + get + { + return ResourceManager.GetString("Start", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Started. + /// + public static string StartedEmulator + { + get + { + return ResourceManager.GetString("StartedEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Starting Emulator.... + /// + public static string StartingEmulator + { + get + { + return ResourceManager.GetString("StartingEmulator", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to start. + /// + public static string StartStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StartStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stop. + /// + public static string Stop + { + get + { + return ResourceManager.GetString("Stop", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopping emulator.... + /// + public static string StopEmulatorMessage + { + get + { + return ResourceManager.GetString("StopEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Stopped. + /// + public static string StoppedEmulatorMessage + { + get + { + return ResourceManager.GetString("StoppedEmulatorMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to stop. + /// + public static string StopStorageEmulatorCommandArgument + { + get + { + return ResourceManager.GetString("StopStorageEmulatorCommandArgument", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Account Name:. + /// + public static string StorageAccountName + { + get + { + return ResourceManager.GetString("StorageAccountName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find storage account '{0}' please type the name of an existing storage account.. + /// + public static string StorageAccountNotFound + { + get + { + return ResourceManager.GetString("StorageAccountNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to AzureStorageEmulator.exe. + /// + public static string StorageEmulatorExe + { + get + { + return ResourceManager.GetString("StorageEmulatorExe", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to InstallPath. + /// + public static string StorageEmulatorInstallPathRegistryKeyValue + { + get + { + return ResourceManager.GetString("StorageEmulatorInstallPathRegistryKeyValue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to SOFTWARE\Microsoft\Windows Azure Storage Emulator. + /// + public static string StorageEmulatorRegistryKey + { + get + { + return ResourceManager.GetString("StorageEmulatorRegistryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Primary Key:. + /// + public static string StoragePrimaryKey + { + get + { + return ResourceManager.GetString("StoragePrimaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Secondary Key:. + /// + public static string StorageSecondaryKey + { + get + { + return ResourceManager.GetString("StorageSecondaryKey", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription named {0} already exists.. + /// + public static string SubscriptionAlreadyExists + { + get + { + return ResourceManager.GetString("SubscriptionAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information.. + /// + public static string SubscriptionDataFileDeprecated + { + get + { + return ResourceManager.GetString("SubscriptionDataFileDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to DefaultSubscriptionData.xml. + /// + public static string SubscriptionDataFileName + { + get + { + return ResourceManager.GetString("SubscriptionDataFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription data file {0} does not exist.. + /// + public static string SubscriptionDataFileNotFound + { + get + { + return ResourceManager.GetString("SubscriptionDataFileNotFound", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription id {0} doesn't exist.. + /// + public static string SubscriptionIdNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionIdNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription must not be null. + /// + public static string SubscriptionMustNotBeNull + { + get + { + return ResourceManager.GetString("SubscriptionMustNotBeNull", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription name needs to be specified.. + /// + public static string SubscriptionNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The subscription name {0} doesn't exist.. + /// + public static string SubscriptionNameNotFoundMessage + { + get + { + return ResourceManager.GetString("SubscriptionNameNotFoundMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Subscription needs to be specified.. + /// + public static string SubscriptionNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("SubscriptionNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Suspend. + /// + public static string Suspend + { + get + { + return ResourceManager.GetString("Suspend", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Swapping website production slot .... + /// + public static string SwappingWebsite + { + get + { + return ResourceManager.GetString("SwappingWebsite", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Are you sure you want to swap the website '{0}' production slot with slot '{1}'?. + /// + public static string SwapWebsiteSlotWarning + { + get + { + return ResourceManager.GetString("SwapWebsiteSlotWarning", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The Switch-AzureMode cmdlet is deprecated and will be removed in a future release.. + /// + public static string SwitchAzureModeDeprecated + { + get + { + return ResourceManager.GetString("SwitchAzureModeDeprecated", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}'. + /// + public static string TraceBeginLROJob + { + get + { + return ResourceManager.GetString("TraceBeginLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}'. + /// + public static string TraceBlockLROThread + { + get + { + return ResourceManager.GetString("TraceBlockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Completing cmdlet execution in RunJob. + /// + public static string TraceEndLROJob + { + get + { + return ResourceManager.GetString("TraceEndLROJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}'. + /// + public static string TraceHandleLROStateChange + { + get + { + return ResourceManager.GetString("TraceHandleLROStateChange", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job due to stoppage or failure. + /// + public static string TraceHandlerCancelJob + { + get + { + return ResourceManager.GetString("TraceHandlerCancelJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Unblocking job that was previously blocked.. + /// + public static string TraceHandlerUnblockJob + { + get + { + return ResourceManager.GetString("TraceHandlerUnblockJob", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Error in cmdlet execution. + /// + public static string TraceLROJobException + { + get + { + return ResourceManager.GetString("TraceLROJobException", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: Removing state changed event handler, exception '{0}'. + /// + public static string TraceRemoveLROEventHandler + { + get + { + return ResourceManager.GetString("TraceRemoveLROEventHandler", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [AzureLongRunningJob]: ShouldMethod '{0}' unblocked.. + /// + public static string TraceUnblockLROThread + { + get + { + return ResourceManager.GetString("TraceUnblockLROThread", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}.. + /// + public static string UnableToDecodeBase64String + { + get + { + return ResourceManager.GetString("UnableToDecodeBase64String", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Unable to update mismatching Json structured: {0} {1}.. + /// + public static string UnableToPatchJson + { + get + { + return ResourceManager.GetString("UnableToPatchJson", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The provider {0} is unknown.. + /// + public static string UnknownProviderMessage + { + get + { + return ResourceManager.GetString("UnknownProviderMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Update. + /// + public static string Update + { + get + { + return ResourceManager.GetString("Update", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Updated settings for subscription '{0}'. Current subscription is '{1}'.. + /// + public static string UpdatedSettings + { + get + { + return ResourceManager.GetString("UpdatedSettings", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name is not valid.. + /// + public static string UserNameIsNotValid + { + get + { + return ResourceManager.GetString("UserNameIsNotValid", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to User name needs to be specified.. + /// + public static string UserNameNeedsToBeSpecified + { + get + { + return ResourceManager.GetString("UserNameNeedsToBeSpecified", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A value for the VLan Id has to be provided.. + /// + public static string VlanIdRequired + { + get + { + return ResourceManager.GetString("VlanIdRequired", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Please wait.... + /// + public static string WaitMessage + { + get + { + return ResourceManager.GetString("WaitMessage", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to The azure storage emulator is not installed, skip launching.... + /// + public static string WarningWhenStorageEmulatorIsMissing + { + get + { + return ResourceManager.GetString("WarningWhenStorageEmulatorIsMissing", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Web.cloud.config. + /// + public static string WebCloudConfig + { + get + { + return ResourceManager.GetString("WebCloudConfig", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to web.config. + /// + public static string WebConfigTemplateFileName + { + get + { + return ResourceManager.GetString("WebConfigTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to MSDeploy. + /// + public static string WebDeployKeywordInWebSitePublishProfile + { + get + { + return ResourceManager.GetString("WebDeployKeywordInWebSitePublishProfile", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot build the project successfully. Please see logs in {0}.. + /// + public static string WebProjectBuildFailTemplate + { + get + { + return ResourceManager.GetString("WebProjectBuildFailTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole. + /// + public static string WebRole + { + get + { + return ResourceManager.GetString("WebRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_web.cmd > log.txt. + /// + public static string WebRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WebRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebRole.xml. + /// + public static string WebRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WebRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Webspace.. + /// + public static string WebsiteAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WebSite with given name {0} already exists in the specified Subscription and Location.. + /// + public static string WebsiteAlreadyExistsReplacement + { + get + { + return ResourceManager.GetString("WebsiteAlreadyExistsReplacement", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Site {0} already has repository created for it.. + /// + public static string WebsiteRepositoryAlreadyExists + { + get + { + return ResourceManager.GetString("WebsiteRepositoryAlreadyExists", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Workspaces/WebsiteExtension/Website/{0}/dashboard/. + /// + public static string WebsiteSufixUrl + { + get + { + return ResourceManager.GetString("WebsiteSufixUrl", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to https://{0}/msdeploy.axd?site={1}. + /// + public static string WebSiteWebDeployUriTemplate + { + get + { + return ResourceManager.GetString("WebSiteWebDeployUriTemplate", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole. + /// + public static string WorkerRole + { + get + { + return ResourceManager.GetString("WorkerRole", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to setup_worker.cmd > log.txt. + /// + public static string WorkerRoleStartupTaskCommandLine + { + get + { + return ResourceManager.GetString("WorkerRoleStartupTaskCommandLine", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WorkerRole.xml. + /// + public static string WorkerRoleTemplateFileName + { + get + { + return ResourceManager.GetString("WorkerRoleTemplateFileName", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to (x86). + /// + public static string x86InProgramFiles + { + get + { + return ResourceManager.GetString("x86InProgramFiles", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes. + /// + public static string Yes + { + get + { + return ResourceManager.GetString("Yes", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Yes, I agree. + /// + public static string YesHint + { + get + { + return ResourceManager.GetString("YesHint", resourceCulture); + } + } + } +} diff --git a/swaggerci/storage/generated/runtime/Properties/Resources.resx b/swaggerci/storage/generated/runtime/Properties/Resources.resx new file mode 100644 index 000000000000..598cd53e958a --- /dev/null +++ b/swaggerci/storage/generated/runtime/Properties/Resources.resx @@ -0,0 +1,1741 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + The remote server returned an error: (401) Unauthorized. + + + Account "{0}" has been added. + + + To switch to a different subscription, please use Select-AzureSubscription. + + + Subscription "{0}" is selected as the default subscription. + + + To view all the subscriptions, please use Get-AzureSubscription. + + + Add-On {0} is created successfully. + + + Add-on name {0} is already used. + + + Add-On {0} not found. + + + Add-on {0} is removed successfully. + + + Add-On {0} is updated successfully. + + + Role has been created at {0}\{1}. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for Node.js by running ‘npm install azure’. + + + Role has been created at {0}\{1}. For easy access to Microsoft Azure services from your application code, install the Microsoft Azure client library for PHP by running "pear WindowsAzure/WindowsAzure". + + + Unable to set role permissions. Please give the 'Network Service' user 'Read & execute' and 'Modify' permissions to the role folder, or run PowerShell as an Administrator + + + A role name '{0}' already exists + + + Windows Azure Powershell\ + + + https://manage.windowsazure.com + + + AZURE_PORTAL_URL + + + Azure SDK\{0}\ + + + Base Uri was empty. + WAPackIaaS + + + {0} begin processing without ParameterSet. + + + {0} begin processing with ParameterSet '{1}'. + + + Blob with the name {0} already exists in the account. + + + https://{0}.blob.core.windows.net/ + + + AZURE_BLOBSTORAGE_TEMPLATE + + + CACHERUNTIMEURL + + + cache + + + CacheRuntimeVersion + + + Installing caching version {0} for Role '{1}' (the caching version locally installed is: {2}) + + + Cannot find {0} with name {1}. + + + Deployment for service {0} with {1} slot doesn't exist + + + Can't find valid Microsoft Azure role in current directory {0} + + + service {0} configuration file (ServiceConfiguration.Cloud.cscfg) is either null or doesn't exist + + + Invalid service path! Cannot locate ServiceDefinition.csdef in current folder or parent folders. + + + The subscription named {0} with id {1} is not currently imported. You must import this subscription before it can be updated. + + + ManagementCertificate + + + certificate.pfx + + + Certificate imported into CurrentUser\My\{0} + + + Your account does not have access to the private key for certificate {0} + + + {0} {1} deployment for {2} service + + + Cloud service {0} is in {1} state. + + + Changing/Removing public environment '{0}' is not allowed. + + + Service {0} is set to value {1} + + + Choose which publish settings file to use: + + + Microsoft.WindowsAzure.Plugins.Caching.ClientDiagnosticLevel + + + 1 + + + cloud_package.cspkg + + + ServiceConfiguration.Cloud.cscfg + + + Add-ons for {0} + + + Communication could not be established. This could be due to an invalid subscription ID. Note that subscription IDs are case sensitive. + + + Complete + + + config.json + + + VirtualMachine creation failed. + WAPackIaaS + + + Creating the website failed. If this is the first website for this subscription, please create it using the management portal instead. + + + Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core + + + //blobcontainer[@datacenter='{0}'] + + + Setting: {0} as the default and current subscription. To view other subscriptions use Get-AzureSubscription + + + none + + + There are no hostnames which could be used for validation. + + + 8080 + + + 1000 + + + Auto + + + 80 + + + Delete + WAPackIaaS + + + The {0} slot for service {1} is already in {2} state + + + The deployment in {0} slot for service {1} is removed + + + Microsoft.WindowsAzure.Plugins.Caching.DiagnosticLevel + + + 1 + + + The key to add already exists in the dictionary. + + + The array index cannot be less than zero. + + + The supplied array does not have enough room to contain the copied elements. + + + The provided dns {0} doesn't exist + + + Microsoft Azure Certificate + + + Endpoint can't be retrieved for storage account + + + {0} end processing. + + + To use Active Directory authentication, you must configure the ActiveDirectoryEndpoint, ActiveDirectoryTenantId, and ActiveDirectorServiceEndpointResourceId for environment of '{0}'. You can configure these properties for this environment using the Set-AzureEnvironment cmdlet. + + + The environment '{0}' already exists. + + + environments.xml + + + Error creating VirtualMachine + WAPackIaaS + + + Unable to download available runtimes for location '{0}' + + + Error updating VirtualMachine + WAPackIaaS + + + Job Id {0} failed. Error: {1}, ExceptionDetails: {2} + WAPackIaaS + + + The HTTP request was forbidden with client authentication scheme 'Anonymous'. + + + This add-on requires you to purchase the first instance through the Microsoft Azure Portal. Subsequent purchases can be performed through PowerShell. + + + Operation Status: + + + Resources\Scaffolding\General + + + Getting all available Microsoft Azure Add-Ons, this may take few minutes... + + + Name{0}Primary Key{0}Seconday Key + + + Git not found. Please install git and place it in your command line path. + + + Could not find publish settings. Please run Import-AzurePublishSettingsFile. + + + iisnode.dll + + + iisnode + + + iisnode-dev\\release\\x64 + + + iisnode + + + Installing IISNode version {0} in Azure for WebRole '{1}' (the version locally installed is: {2}) + + + Internal Server Error + + + Cannot enable memcach protocol on a cache worker role {0}. + + + Invalid certificate format. + + + The provided configuration path is invalid or doesn't exist + + + The country name is invalid, please use a valid two character country code, as described in ISO 3166-1 alpha-2. + + + Deployment with {0} does not exist + + + The deployment slot name {0} is invalid. Slot name must be either "Staging" or "Production". + + + Invalid service endpoint. + + + File {0} has invalid characters + + + You must create your git publishing credentials using the Microsoft Azure portal. +Please follow these steps in the portal: +1. On the left side open "Web Sites" +2. Click on any website +3. Choose "Setup Git Publishing" or "Reset deployment credentials" +4. Back in the PowerShell window, rerun this command by typing "New-AzureWebSite {site name} -Git -PublishingUsername {username} + + + The value {0} provided is not a valid GUID. Please provide a valid GUID. + + + The specified hostname does not exist. Please specify a valid hostname for the site. + + + Role {0} instances must be greater than or equal 0 and less than or equal 20 + + + There was an error creating your webjob. Please make sure that the script is in the root folder of the zip file. + + + Could not download a valid runtime manifest, Please check your internet connection and try again. + + + The account {0} was not found. Please specify a valid account name. + + + The provided name "{0}" does not match the service bus namespace naming rules. + + + Value cannot be null. Parameter name: '{0}' + + + The provided package path is invalid or doesn't exist + + + '{0}' is an invalid parameter set name. + + + {0} doesn't exist in {1} or you've not passed valid value for it + + + Path {0} has invalid characters + + + The provided publish settings file {0} has invalid content. Please get valid by running cmdlet Get-AzurePublishSettingsFile + + + The provided role name "{0}" has invalid characters + + + A valid name for the service root folder is required + + + {0} is not a recognized runtime type + + + A valid language is required + + + No subscription is currently selected. Use Select-Subscription to activate a subscription. + + + The provided location "{0}" does not exist in the available locations use Get-AzureSBLocation for listing available locations. + + + Please provide a service name or run this command from inside a service project directory. + + + You must provide valid value for {0} + + + settings.json is invalid or doesn't exist + + + The subscription named '{0}' cannot be found. Use Set-AzureSubscription to initialize the subscription data. + + + The provided subscription id {0} is not valid + + + A valid subscription name is required. This can be provided using the -Subscription parameter or by setting the subscription via the Set-AzureSubscription cmdlet + + + The provided subscriptions file {0} has invalid content. + + + Role {0} VM size should be ExtraSmall, Small, Medium, Large or ExtraLarge. + + + The web job file must have *.zip extension + + + Singleton option works for continuous jobs only. + + + The website {0} was not found. Please specify a valid website name. + + + No job for id: {0} was found. + WAPackIaaS + + + engines + + + Scaffolding for this language is not yet supported + + + Link already established + + + local_package.csx + + + ServiceConfiguration.Local.cscfg + + + Looking for {0} deployment for {1} cloud service... + + + Looking for cloud service {0}... + + + managementCertificate.pem + + + ?whr={0} + + + //baseuri + + + uri + + + http://az413943.vo.msecnd.net/node/runtimemanifest_0.7.5.2.xml + + + Multiple Add-Ons found holding name {0} + + + Multiple possible publishing users. Please go to the Portal and use the listed deployment user, or click 'set/reset deployment credentials' to set up a new user account, then reurn this cmdlet and specify PublishingUsername. + + + The first publish settings file "{0}" is used. If you want to use another file specify the file name. + + + Microsoft.WindowsAzure.Plugins.Caching.NamedCaches + + + {"caches":[{"name":"default","policy":{"eviction":{"type":0},"expiration":{"defaultTTL":10,"isExpirable":true,"type":1},"serverNotification":{"isEnabled":false}},"secondaries":0}]} + + + A publishing username is required. Please specify one using the argument PublishingUsername. + + + New Add-On Confirmation + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Internal Server Error. This could happen because the namespace name is already used or due to an incorrect location name. Use Get-AzureSBLocation cmdlet to list valid names. + + + By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at {0} and (c) agree to sharing my contact information with {2}. + + + Service has been created at {0} + + + No + + + There is no access token cached for subscription {0}, user id {1}. Use the Add-AzureAccount cmdlet to log in again and get a token for this subscription. + + + The service does not have any cache worker roles, add one first by running cmdlet Add-AzureCacheWorkerRole. + + + No clouds available + WAPackIaaS + + + nodejs + + + node + + + node.exe + + + There is no default subscription set, please set a default subscription by running Set-AzureSubscription -Default <subscription name> + + + Microsoft SDKs\Azure\Nodejs\Nov2011 + + + nodejs + + + node + + + Resources\Scaffolding\Node + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.Node + + + Installing Node version {0} in Azure for Role '{1}' (the Node version locally installed is: {2}) + + + No, I do not agree + + + No publish settings files with extension *.publishsettings are found in the directory "{0}". + + + '{0}' must be a cache worker role. Verify that it has proper cache worker role configuration. + + + Certificate can't be null. + + + {0} could not be null or empty + + + Unable to add a null RoleSettings to {0} + + + Unable to add new role to null service definition + + + The request offer '{0}' is not found. + + + Operation "{0}" failed on VM with ID: {1} + WAPackIaaS + + + The REST operation failed with message '{0}' and error code '{1}' + + + Job Id {0} did not complete within expected time or it is in Failed/Canceled/Invalid state. + WAPackIaaS + + + package + + + Package is created at service root path {0}. + + + {{ + "author": "", + + "name": "{0}", + "version": "0.0.0", + "dependencies":{{}}, + "devDependencies":{{}}, + "optionalDependencies": {{}}, + "engines": {{ + "node": "*", + "iisnode": "*" + }} + +}} + + + + package.json + + + A value for the Peer Asn has to be provided. + + + 5.4.0 + + + php + + + Resources\Scaffolding\PHP + + + Microsoft.WindowsAzure.Commands.CloudService.ScaffoldingResources.PHP + + + Installing PHP version {0} for Role '{1}' (the PHP version locally installed is: {2}) + + + You must create your first web site using the Microsoft Azure portal. +Please follow these steps in the portal: +1. At the bottom of the page, click on New > Web Site > Quick Create +2. Type {0} in the URL field +3. Click on "Create Web Site" +4. Once the site has been created, click on the site name +5. Click on "Set up Git publishing" or "Reset deployment credentials" and setup a publishing username and password. Use those credentials for all new websites you create. + + + 6. Back in the console window, rerun this command by typing "New-AzureWebsite <site name> -Git" + + + A value for the Primary Peer Subnet has to be provided. + + + Promotion code can be used only when updating to a new plan. + + + Service not published at user request. + + + Complete. + + + Connecting... + + + Created Deployment ID: {0}. + + + Created hosted service '{0}'. + + + Created Website URL: {0}. + + + Creating... + + + Initializing... + + + busy + + + creating the virtual machine + + + Instance {0} of role {1} is {2}. + + + ready + + + Preparing deployment for {0} with Subscription ID: {1}... + + + Publishing {0} to Microsoft Azure. This may take several minutes... + + + publish settings + + + Azure + + + .PublishSettings + + + publishSettings.xml + + + Publish settings imported + + + AZURE_PUBLISHINGPROFILE_URL + + + Starting... + + + Upgrading... + + + Uploading Package to storage service {0}... + + + Verifying storage account '{0}'... + + + Replace current deployment with '{0}' Id ? + + + Are you sure you want to regenerate key? + + + Generate new key. + + + Are you sure you want to remove account '{0}'? + + + Removing account + + + Remove Add-On Confirmation + + + If you delete this add-on, your data may be deleted and the operation may not be undone. You may have to purchase it again from the Microsoft Azure Store to use it. The price of the add-on may not be refunded. Are you sure you want to delete this add-on? Enter “Yes” to confirm. + + + Remove-AzureBGPPeering Operation failed. + + + Removing Bgp Peering + + + Successfully removed Azure Bgp Peering with Service Key {0}. + + + Are you sure you want to remove the Bgp Peering with service key '{0}'? + + + Are you sure you want to remove the Dedicated Circuit with service key '{0}'? + + + Remove-AzureDedicatedCircuit Operation failed. + + + Remove-AzureDedicatedCircuitLink Operation failed. + + + Removing Dedicated Circui Link + + + Successfully removed Azure Dedicated Circuit Link with Service Key {0} and Vnet Name {1} + + + Are you sure you want to remove the Dedicated Circuit Link with service key '{0}' and virtual network name '{1}'? + + + Removing Dedicated Circuit + + + Successfully removed Azure Dedicated Circuit with Service Key {0}. + + + Removing cloud service {0}... + + + Removing {0} deployment for {1} service + + + Removing job collection + + + Are you sure you want to remove the job collection "{0}" + + + Removing job + + + Are you sure you want to remove the job "{0}" + + + Are you sure you want to remove the account? + + + Account removed. + + + Internal Server Error. This could happen because the namespace does not exist or it does not exist under your subscription. + + + Removing old package {0}... + + + Are you sure you want to delete the namespace '{0}'? + + + Are you sure you want to remove cloud service? + + + Remove cloud service and all it's deployments + + + Are you sure you want to remove subscription '{0}'? + + + Removing subscription + + + Are you sure you want to delete the VM '{0}'? + + + Deleting VM. + + + Removing WebJob... + + + Are you sure you want to remove job '{0}'? + + + Removing website + + + Are you sure you want to remove the website "{0}" + + + Deleting namespace + + + Repository is not setup. You need to pass a valid site name. + + + Reserved IP with the Name:'{0}' will no longer be in use after the deployment is deleted, and it is still reserved for later use. + + + Resource with ID : {0} does not exist. + WAPackIaaS + + + Restart + WAPackIaaS + + + Resume + WAPackIaaS + + + /role:{0};"{1}/{0}" + + + bin + + + Role {0} is {1} + + + 20 + + + role name + + + The provided role name {0} doesn't exist + + + RoleSettings.xml + + + Role type {0} doesn't exist + + + public static Dictionary<string, Location> ReverseLocations { get; private set; } + + + Preparing runtime deployment for service '{0}' + + + WARNING Runtime Mismatch: Are you sure that you want to publish service '{0}' using an Azure runtime version that does not match your local runtime version? + + + RUNTIMEOVERRIDEURL + + + /runtimemanifest/runtimes/runtime + + + RUNTIMEID + + + RUNTIMEURL + + + RUNTIMEVERSIONPRIMARYKEY + + + scaffold.xml + + + Invalid location entered. Pick one of the locations from Get-AzureSchedulerLocation + + + A value for the Secondary Peer Subnet has to be provided. + + + Service {0} already exists on disk in location {1} + + + No ServiceBus authorization rule with the given characteristics was found + + + The service bus entity '{0}' is not found. + + + Internal Server Error. This could happen due to an incorrect/missing namespace + + + service configuration + + + service definition + + + ServiceDefinition.csdef + + + {0}Deploy + + + The specified cloud service "{0}" does not exist. + + + {0} slot for service {1} is in {2} state, please wait until it finish and update it's status + + + Begin Operation: {0} + + + Completed Operation: {0} + + + Begin Operation: {0} + + + Completed Operation: {0} + + + service name + + + Please provide name for the hosted service + + + service parent directory + + + Service {0} removed successfully + + + service directory + + + service settings + + + The storage account name '{0}' is invalid. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only. + + + The {0} slot for cloud service {1} doesn't exist. + + + {0} slot for service {1} is {2} + + + Set Add-On Confirmation + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +agree to the {2}'s terms of user and privacy statement at {0} and (c) agree to sharing my +contact information with {2}. + + + Note - You will be charged the amount for the new plan, without being refunded for time remaining +in the existing plan. +By typing "Yes", I (a) authorize Microsoft to charge my current payment method on a monthly basis +for the amount indicated at {0} for {1} until my service is cancelled or terminated, and (b) +acknowledge the offering is provided by {2}, not Microsoft, and agree to {2}'s terms of +use and privacy statement at <url> and (c) agree to sharing my contact information with {2}. + + + Role {0} instances are set to {1} + + + {"Slot":"","Location":"","Subscription":"","StorageAccountName":""} + + + deploymentSettings.json + + + Confirm + + + Shutdown + WAPackIaaS + + + /sites:{0};{1};"{2}/{0}" + + + 1000 + + + Start + WAPackIaaS + + + Started + + + Starting Emulator... + + + start + + + Stop + WAPackIaaS + + + Stopping emulator... + + + Stopped + + + stop + + + Account Name: + + + Cannot find storage account '{0}' please type the name of an existing storage account. + + + AzureStorageEmulator.exe + + + InstallPath + + + SOFTWARE\Microsoft\Windows Azure Storage Emulator + + + Primary Key: + + + Secondary Key: + + + The subscription named {0} already exists. + + + DefaultSubscriptionData.xml + + + The subscription data file {0} does not exist. + + + Subscription must not be null + WAPackIaaS + + + Suspend + WAPackIaaS + + + Swapping website production slot ... + + + Are you sure you want to swap the website '{0}' production slot with slot '{1}'? + + + The provider {0} is unknown. + + + Update + WAPackIaaS + + + Updated settings for subscription '{0}'. Current subscription is '{1}'. + + + A value for the VLan Id has to be provided. + + + Please wait... + + + The azure storage emulator is not installed, skip launching... + + + Web.cloud.config + + + web.config + + + MSDeploy + + + Cannot build the project successfully. Please see logs in {0}. + + + WebRole + + + setup_web.cmd > log.txt + + + WebRole.xml + + + WebSite with given name {0} already exists in the specified Subscription and Webspace. + + + WebSite with given name {0} already exists in the specified Subscription and Location. + + + Site {0} already has repository created for it. + + + Workspaces/WebsiteExtension/Website/{0}/dashboard/ + + + https://{0}/msdeploy.axd?site={1} + + + WorkerRole + + + setup_worker.cmd > log.txt + + + WorkerRole.xml + + + Yes + + + Yes, I agree + + + Remove-AzureTrafficManagerProfile Operation failed. + + + Successfully removed Traffic Manager profile with name {0}. + + + Are you sure you want to remove the Traffic Manager profile "{0}"? + + + Profile {0} already has an endpoint with name {1} + + + Profile {0} does not contain endpoint {1}. Adding it. + + + The endpoint {0} cannot be removed from profile {1} because it's not in the profile. + + + Insufficient parameters passed to create a new endpoint. + + + Ambiguous operation: the profile name specified doesn't match the name of the profile object. + + + <NONE> + + + "An exception occurred when calling the ServiceManagement API. HTTP Status Code: {0}. Service Management Error Code: {1}. Message: {2}. Operation Tracking ID: {3}." + {0} is the HTTP status code. {1} is the Service Management Error Code. {2} is the Service Management Error message. {3} is the operation tracking ID. + + + Unable to decode string from base 64. Please make sure the string is correctly encoded: {0}. + {0} is the string that is not in a valid base 64 format. + + + Skipping external tenant {0}, because you are using a guest or a foreign principal object identity. In order to access this tenant, please run Add-AzureAccount without "-Credential". + + + Removing an environment will remove all associated subscriptions and accounts. Are you sure you want to remove an environment '{0}'? + + + Removing environment + + + There is no subscription associated with account {0}. + + + Account id doesn't match one in subscription. + + + Environment name doesn't match one in subscription. + + + Removing the Azure profile will remove all associated environments, subscriptions, and accounts. Are you sure you want to remove the Azure profile? + + + Removing the Azure profile + + + The SubscriptionDataFile parameter is deprecated. This parameter will be removed in a future release. See https://github.com/Azure/azure-powershell/wiki/Proposed-Design-Stateless-Azure-Profile for a description of the upcoming mechanism for providing alternate sources of subscription information. + + + Account needs to be specified + + + No default subscription has been designated. Use Select-AzureSubscription -Default <subscriptionName> to set the default subscription. + + + Path must specify a valid path to an Azure profile. + + + Property bag Hashtable must contain one of the following sets of properties: {SubscriptionId, Certificate}, {SubscriptionId, Username, Password}, {SubscriptionId, ServicePrincipal, Password, Tenant}, {SubscriptionId, AccountId, Token} + + + Property bag Hashtable must contain a 'Certificate' of type 'X509Certificate2'. + + + Property bag Hashtable must contain a 'Password' with an associated 'Username' or 'ServicePrincipal'. + + + Property bag Hashtable must contain a 'SubscriptionId'. + + + Selected profile must not be null. + + + The Switch-AzureMode cmdlet is deprecated and will be removed in a future release. + + + OperationID : '{0}' + + + Cannot get module for DscResource '{0}'. Possible solutions: +1) Specify -ModuleName for Import-DscResource in your configuration. +2) Unblock module that contains resource. +3) Move Import-DscResource inside Node block. + + 0 = name of DscResource + + + Your current PowerShell version {1} is less then required by this cmdlet {0}. Consider download and install latest PowerShell version. + {0} = minimal required PS version, {1} = current PS version + + + Parsing configuration script: {0} + {0} is the path to a script file + + + Configuration script '{0}' contained parse errors: +{1} + 0 = path to the configuration script, 1 = parser errors + + + List of required modules: [{0}]. + {0} = list of modules + + + Temp folder '{0}' created. + {0} = temp folder path + + + Copy '{0}' to '{1}'. + {0} = source, {1} = destination + + + Copy the module '{0}' to '{1}'. + {0} = source, {1} = destination + + + File '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the path to a file + + + Configuration file '{0}' not found. + 0 = path to the configuration file + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Path '{0}' not found. + 0 = path to the additional content file/directory + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1) or a ZIP archive (.zip). + 0 = path to the configuration file + + + Invalid configuration file: {0}. +The file needs to be a PowerShell script (.ps1 or .psm1). + 0 = path to the configuration file + + + Create Archive + + + Upload '{0}' + {0} is the name of an storage blob + + + Storage Blob '{0}' already exists. Use the -Force parameter to overwrite it. + {0} is the name of an storage blob + + + Configuration published to {0} + {0} is an URI + + + Deleted '{0}' + {0} is the path of a file + + + Cannot delete '{0}': {1} + {0} is the path of a file, {1} is an error message + + + Cannot find the WadCfg end element in the config. + + + WadCfg start element in the config is not matching the end element. + + + Cannot find the WadCfg element in the config. + + + Cannot find configuration data file: {0} + + + The configuration data must be a .psd1 file + + + Cannot change built-in environment {0}. + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Az.Accounts module. To disable data collection: PS > Disable-AzDataCollection. +Use the Enable-AzDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Az.Accounts module. To enable data collection: PS > Enable-AzDataCollection. + + + Microsoft Azure PowerShell Data Collection Confirmation + + + You choose not to participate in Microsoft Azure PowerShell data collection. + + + This confirmation message will be dismissed in '{0}' second(s)... + + + You choose to participate in Microsoft Azure PowerShell data collection. + + + The setting profile has been saved to the following path '{0}'. + + + [Common.Authentication]: Authenticating for account {0} with single tenant {1}. + + + Changing public environment is not supported. + + + Environment name needs to be specified. + + + Environment needs to be specified. + + + The environment name '{0}' is not found. + + + File path is not valid. + + + Must specify a non-null subscription name. + + + The default subscription is being removed. Use Select-AzureSubscription -Default <subscriptionName> to select a new default subscription. + + + Removing public environment is not supported. + + + The subscription id {0} doesn't exist. + + + Subscription name needs to be specified. + + + The subscription name {0} doesn't exist. + + + Subscription needs to be specified. + + + User name is not valid. + + + User name needs to be specified. + + + "There is no current context, please log in using Connect-AzAccount." + + + No subscriptions are associated with the logged in account in Azure Service Management (RDFE). This means that the logged in user is not an administrator or co-administrator for any account.\r\nDid you mean to execute Connect-AzAccount? + + + No certificate was found in the certificate store with thumbprint {0} + + + Illegal characters in path. + + + Invalid certificate format. Publish settings may be corrupted. Use Get-AzurePublishSettingsFile to download updated settings + + + "{0}" is an invalid DNS name for {1} + + + The provided file in {0} must be have {1} extension + + + {0} is invalid or empty + + + Please connect to internet before executing this cmdlet + + + Path {0} doesn't exist. + + + Path for {0} doesn't exist in {1}. + + + &whr={0} + + + The provided service name {0} already exists, please pick another name + + + Unable to update mismatching Json structured: {0} {1}. + + + (x86) + + + Azure PowerShell collects usage data in order to improve your experience. +The data is anonymous and does not include commandline argument values. +The data is collected by Microsoft. + +Use the Disable-AzureDataCollection cmdlet to turn the feature Off. The cmdlet can be found in the Azure module. To disable data collection: PS > Disable-AzureDataCollection. +Use the Enable-AzureDataCollection cmdlet to turn the feature On. The cmdlet can be found in the Azure module. To enable data collection: PS > Enable-AzureDataCollection. + + + Execution failed because a background thread could not prompt the user. + + + Azure Long-Running Job + + + The cmdlet failed in background execution. The returned error was '{0}'. Please execute the cmdlet again. You may need to execute this cmdlet synchronously, by omitting the '-AsJob' parameter. + 0(string): exception message in background task + + + Please execute the cmdlet again and include the 'Force' parameter, if available, to avoid unnecessary prompts. + + + Please execute the cmdlet again and omit the 'Confirm' parameter when using the 'AsJob' parameter. + + + Please increase the user $ConfirmPreference setting, or include turn off confirmation using '-Confirm:$false' when using the 'AsJob' parameter and execute the cmdet again. + + + Please execute the cmdlet again and omit the 'WhatIf' parameter when using the 'AsJob' parameter. + + + [AzureLongRunningJob]: Starting cmdlet execution, setting for cmdlet confirmation required: '{0}' + 0(bool): whether cmdlet confirmation is required + + + [AzureLongRunningJob]: Blocking job for ShouldMethod '{0}' + 0(string): method type + + + [AzureLongRunningJob]: Completing cmdlet execution in RunJob + + + [AzureLongRunningJob]: State change from '{0}' to '{1}' because '{2}' + 0(string): last state, 1(string): new state, 2(string): state change reason + + + [AzureLongRunningJob]: Unblocking job due to stoppage or failure + + + [AzureLongRunningJob]: Unblocking job that was previously blocked. + + + [AzureLongRunningJob]: Error in cmdlet execution + + + [AzureLongRunningJob]: Removing state changed event handler, exception '{0}' + 0(string): exception message + + + [AzureLongRunningJob]: ShouldMethod '{0}' unblocked. + 0(string): methodType + + + +- The parameter : '{0}' is changing. + + + +- The parameter : '{0}' is becoming mandatory. + + + +- The parameter : '{0}' is being replaced by parameter : '{1}'. + + + +- The parameter : '{0}' is being replaced by mandatory parameter : '{1}'. + + + +- Change description : {0} + + + The cmdlet is being deprecated. There will be no replacement for it. + + + The cmdlet parameter set is being deprecated. There will be no replacement for it. + + + The cmdlet '{0}' is replacing this cmdlet. + + + +- The output type is changing from the existing type :'{0}' to the new type :'{1}' + + + +- The output type '{0}' is changing + + + +- The following properties are being added to the output type : + + + +- The following properties in the output type are being deprecated : + + + {0} + + + +- Cmdlet : '{0}' + - {1} + + + Upcoming breaking changes in the cmdlet '{0}' : + + + +- This change will take effect on '{0}' + + + +- The change is expected to take effect from the version : '{0}' + + + ```powershell +# Old +{0} + +# New +{1} +``` + + + + +Cmdlet invocation changes : + Old Way : {0} + New Way : {1} + + + +The output type '{0}' is being deprecated without a replacement. + + + +The type of the parameter is changing from '{0}' to '{1}'. + + + +Note : Go to {0} for steps to suppress this breaking change warning, and other information on breaking changes in Azure PowerShell. + + + This cmdlet is in preview. The functionality may not be available in the selected subscription. + + \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Response.cs b/swaggerci/storage/generated/runtime/Response.cs new file mode 100644 index 000000000000..bea09d68fcd2 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Response.cs @@ -0,0 +1,27 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System; + using System.Threading.Tasks; + public class Response : EventData + { + public Response() : base() + { + } + } + + public class Response : Response + { + private Func> _resultDelegate; + private Task _resultValue; + + public Response(T value) : base() => _resultValue = Task.FromResult(value); + public Response(Func value) : base() => _resultDelegate = () => Task.FromResult(value()); + public Response(Func> value) : base() => _resultDelegate = value; + public Task Result => _resultValue ?? (_resultValue = this._resultDelegate()); + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Serialization/JsonSerializer.cs b/swaggerci/storage/generated/runtime/Serialization/JsonSerializer.cs new file mode 100644 index 000000000000..dc84b14cec00 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Serialization/JsonSerializer.cs @@ -0,0 +1,350 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal class JsonSerializer + { + private int depth = 0; + + private SerializationOptions options = new SerializationOptions(); + + #region Deserialization + + internal T Deseralize(JsonObject json) + where T : new() + { + var contract = JsonModelCache.Get(typeof(T)); + + return (T)DeserializeObject(contract, json); + } + + internal object DeserializeObject(JsonModel contract, JsonObject json) + { + var instance = Activator.CreateInstance(contract.Type); + + depth++; + + // Ensure we don't recurse forever + if (depth > 5) throw new Exception("Depth greater than 5"); + + foreach (var field in json) + { + var member = contract[field.Key]; + + if (member != null) + { + var value = DeserializeValue(member, field.Value); + + member.SetValue(instance, value); + } + } + + depth--; + + return instance; + } + + private object DeserializeValue(JsonMember member, JsonNode value) + { + if (value.Type == JsonType.Null) return null; + + var type = member.Type; + + if (member.IsStringLike && value.Type != JsonType.String) + { + // Take the long path... + return DeserializeObject(JsonModelCache.Get(type), (JsonObject)value); + } + else if (member.Converter != null) + { + return member.Converter.FromJson(value); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (member.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + private object DeserializeValue(Type type, JsonNode value) + { + if (type == null) throw new ArgumentNullException(nameof(type)); + + if (value.Type == JsonType.Null) return null; + + var typeDetails = TypeDetails.Get(type); + + if (typeDetails.JsonConverter != null) + { + return typeDetails.JsonConverter.FromJson(value); + } + else if (typeDetails.IsEnum) + { + return Enum.Parse(type, value.ToString(), ignoreCase: true); + } + else if (type.IsArray) + { + return DeserializeArray(type, (JsonArray)value); + } + else if (typeDetails.IsList) + { + return DeserializeList(type, (JsonArray)value); + } + else + { + var contract = JsonModelCache.Get(type); + + return DeserializeObject(contract, (JsonObject)value); + } + } + + internal Array DeserializeArray(Type type, JsonArray elements) + { + var elementType = type.GetElementType(); + + var elementTypeDetails = TypeDetails.Get(elementType); + + var array = Array.CreateInstance(elementType, elements.Count); + + int i = 0; + + if (elementTypeDetails.JsonConverter != null) + { + foreach (var value in elements) + { + array.SetValue(elementTypeDetails.JsonConverter.FromJson(value), i); + + i++; + } + } + else + { + foreach (var value in elements) + { + array.SetValue(DeserializeValue(elementType, value), i); + + i++; + } + } + + return array; + } + + internal IList DeserializeList(Type type, JsonArray jsonArray) + { + // TODO: Handle non-generic types + if (!type.IsGenericType) + throw new ArgumentException("Must be a generic type", nameof(type)); + + var elementType = type.GetGenericArguments()[0]; + + IList list; + + if (type.IsInterface) + { + // Create a concrete generic list + list = (IList)Activator.CreateInstance(typeof(List<>).MakeGenericType(elementType)); + } + else + { + list = (IList)Activator.CreateInstance(type); + } + + foreach (var value in jsonArray) + { + list.Add(DeserializeValue(elementType, value)); + } + + return list; + } + + #endregion + + #region Serialization + + internal JsonNode Serialize(object instance) => + Serialize(instance, SerializationOptions.Default); + + internal JsonNode Serialize(object instance, string[] include) => + Serialize(instance, new SerializationOptions { Include = include }); + + internal JsonNode Serialize(object instance, SerializationOptions options) + { + this.options = options; + + if (instance == null) + { + return XNull.Instance; + } + + return ReadValue(instance.GetType(), instance); + } + + #region Readers + + internal JsonArray ReadArray(IEnumerable collection) + { + var array = new XNodeArray(); + + foreach (var item in collection) + { + array.Add(ReadValue(item.GetType(), item)); + } + + return array; + } + + internal IEnumerable> ReadProperties(object instance) + { + var contract = JsonModelCache.Get(instance.GetType()); + + foreach (var member in contract.Members) + { + string name = member.Name; + + if (options.PropertyNameTransformer != null) + { + name = options.PropertyNameTransformer.Invoke(name); + } + + // Skip the field if it's not included + if ((depth == 1 && !options.IsIncluded(name))) + { + continue; + } + + var value = member.GetValue(instance); + + if (!member.EmitDefaultValue && (value == null || (member.IsList && ((IList)value).Count == 0) || value.Equals(member.DefaultValue))) + { + continue; + } + else if (options.IgnoreNullValues && value == null) // Ignore null values + { + continue; + } + + // Transform the value if there is one + if (options.Transformations != null) + { + var transform = options.GetTransformation(name); + + if (transform != null) + { + value = transform.Transformer(value); + } + } + + yield return new KeyValuePair(name, ReadValue(member.TypeDetails, value)); + } + } + + private JsonObject ReadObject(object instance) + { + depth++; + + // TODO: Guard against a self referencing graph + if (depth > options.MaxDepth) + { + depth--; + + return new JsonObject(); + } + + var node = new JsonObject(ReadProperties(instance)); + + depth--; + + return node; + } + + private JsonNode ReadValue(Type type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + var member = TypeDetails.Get(type); + + return ReadValue(member, value); + } + + private JsonNode ReadValue(TypeDetails type, object value) + { + if (value == null) + { + return XNull.Instance; + } + + if (type.JsonConverter != null) + { + return type.JsonConverter.ToJson(value); + } + else if (type.IsArray) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateArray((string[])value); + case TypeCode.UInt16: return CreateArray((ushort[])value); + case TypeCode.UInt32: return CreateArray((uint[])value); + case TypeCode.UInt64: return CreateArray((ulong[])value); + case TypeCode.Int16: return CreateArray((short[])value); + case TypeCode.Int32: return CreateArray((int[])value); + case TypeCode.Int64: return CreateArray((long[])value); + case TypeCode.Single: return CreateArray((float[])value); + case TypeCode.Double: return CreateArray((double[])value); + default: return ReadArray((IEnumerable)value); + } + } + else if (value is IEnumerable) + { + if (type.IsList && type.ElementType != null) + { + switch (Type.GetTypeCode(type.ElementType)) + { + case TypeCode.String: return CreateList(value); + case TypeCode.UInt16: return CreateList(value); + case TypeCode.UInt32: return CreateList(value); + case TypeCode.UInt64: return CreateList(value); + case TypeCode.Int16: return CreateList(value); + case TypeCode.Int32: return CreateList(value); + case TypeCode.Int64: return CreateList(value); + case TypeCode.Single: return CreateList(value); + case TypeCode.Double: return CreateList(value); + } + } + + return ReadArray((IEnumerable)value); + } + else + { + // Complex object + return ReadObject(value); + } + } + + private XList CreateList(object value) => new XList((IList)value); + + private XImmutableArray CreateArray(T[] array) => new XImmutableArray(array); + + #endregion + + #endregion + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Serialization/PropertyTransformation.cs b/swaggerci/storage/generated/runtime/Serialization/PropertyTransformation.cs new file mode 100644 index 000000000000..c933f2215862 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Serialization/PropertyTransformation.cs @@ -0,0 +1,21 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal class PropertyTransformation + { + internal PropertyTransformation(string name, Func transformer) + { + Name = name ?? throw new ArgumentNullException(nameof(name)); + Transformer = transformer ?? throw new ArgumentNullException(nameof(transformer)); + } + + internal string Name { get; } + + internal Func Transformer { get; } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Serialization/SerializationOptions.cs b/swaggerci/storage/generated/runtime/Serialization/SerializationOptions.cs new file mode 100644 index 000000000000..721bdffec894 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Serialization/SerializationOptions.cs @@ -0,0 +1,65 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Linq; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal class SerializationOptions + { + internal static readonly SerializationOptions Default = new SerializationOptions(); + + internal SerializationOptions() { } + + internal SerializationOptions( + string[] include = null, + bool ingoreNullValues = false) + { + Include = include; + IgnoreNullValues = ingoreNullValues; + } + + internal string[] Include { get; set; } + + internal string[] Exclude { get; set; } + + internal bool IgnoreNullValues { get; set; } + + internal PropertyTransformation[] Transformations { get; set; } + + internal Func PropertyNameTransformer { get; set; } + + internal int MaxDepth { get; set; } = 5; + + internal bool IsIncluded(string name) + { + if (Exclude != null) + { + return !Exclude.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + else if (Include != null) + { + return Include.Any(exclude => exclude.Equals(name, StringComparison.OrdinalIgnoreCase)); + } + + return true; + } + + internal PropertyTransformation GetTransformation(string propertyName) + { + if (Transformations == null) return null; + + foreach (var t in Transformations) + { + if (t.Name.Equals(propertyName, StringComparison.OrdinalIgnoreCase)) + { + return t; + } + } + + return null; + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/SerializationMode.cs b/swaggerci/storage/generated/runtime/SerializationMode.cs new file mode 100644 index 000000000000..b14dbb32de4c --- /dev/null +++ b/swaggerci/storage/generated/runtime/SerializationMode.cs @@ -0,0 +1,16 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + [System.Flags] + public enum SerializationMode + { + None = 0, + IncludeHeaders = 1 << 0, + IncludeReadOnly = 1 << 1, + + IncludeAll = IncludeHeaders | IncludeReadOnly + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/TypeConverterExtensions.cs b/swaggerci/storage/generated/runtime/TypeConverterExtensions.cs new file mode 100644 index 000000000000..47b16dd82929 --- /dev/null +++ b/swaggerci/storage/generated/runtime/TypeConverterExtensions.cs @@ -0,0 +1,211 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System.IO; +using System.Linq; +using System.Xml; +using System.Xml.Serialization; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.PowerShell +{ + internal static class TypeConverterExtensions + { + internal static T[] SelectToArray(object source, System.Func converter) + { + // null begets null + if (source == null) + { + return null; + } + + // single values and strings are just encapsulated in the array. + if (source is string || !(source is System.Collections.IEnumerable)) + { + try + { + return new T[] { (T)converter(source) }; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + return new T[0]; // empty result if couldn't convert. + } + + var result = new System.Collections.Generic.List(); + foreach (var each in (System.Collections.IEnumerable)source) + { + try + { + result.Add((T)converter(each)); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // silent conversion fail + } +#endif + } + return result.ToArray(); + } + + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.Generic.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Collections.IDictionary dictionary) + { + if (null != dictionary) + { + foreach (var each in dictionary.Keys) + { + yield return each; + } + } + } + internal static System.Collections.Generic.IEnumerable GetPropertyKeys(this System.Management.Automation.PSObject instance) + { + if (null != instance) + { + foreach (var each in instance.Properties) + { + yield return each; + } + } + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.Generic.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Collections.IDictionary instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + return (null == instance || instance.Count == 0) ? + Enumerable.Empty>() : + instance.Keys.OfType() + .Where(key => + !(true == exclusions?.Contains(key?.ToString())) + && (false != inclusions?.Contains(key?.ToString()))) + .Select(key => new System.Collections.Generic.KeyValuePair(key, instance[key])); + } + + internal static System.Collections.Generic.IEnumerable> GetFilteredProperties(this System.Management.Automation.PSObject instance, global::System.Collections.Generic.HashSet exclusions = null, global::System.Collections.Generic.HashSet inclusions = null) + { + // new global::System.Collections.Generic.HashSet(System.StringComparer.InvariantCultureIgnoreCase) + return (null == instance || !instance.Properties.Any()) ? + Enumerable.Empty>() : + instance.Properties + .Where(property => + !(true == exclusions?.Contains(property.Name)) + && (false != inclusions?.Contains(property.Name))) + .Select(property => new System.Collections.Generic.KeyValuePair(property.Name, property.Value)); + } + + + internal static T GetValueForProperty(this System.Collections.Generic.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys, each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + internal static T GetValueForProperty(this System.Collections.IDictionary dictionary, string propertyName, T defaultValue, System.Func converter) + { + try + { + var key = System.Linq.Enumerable.FirstOrDefault(dictionary.Keys.OfType(), each => System.String.Equals(each.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return key == null ? defaultValue : (T)converter(dictionary[key]); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static T GetValueForProperty(this System.Management.Automation.PSObject psObject, string propertyName, T defaultValue, System.Func converter) + { + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + return property == null ? defaultValue : (T)converter(property.Value); + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return defaultValue; + } + + internal static bool Contains(this System.Management.Automation.PSObject psObject, string propertyName) + { + bool result = false; + try + { + var property = System.Linq.Enumerable.FirstOrDefault(psObject.Properties, each => System.String.Equals(each.Name.ToString(), propertyName, System.StringComparison.CurrentCultureIgnoreCase)); + result = property == null ? false : true; + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + } +#endif + return result; + } + } +} diff --git a/swaggerci/storage/generated/runtime/UndeclaredResponseException.cs b/swaggerci/storage/generated/runtime/UndeclaredResponseException.cs new file mode 100644 index 000000000000..3005ed0b86f5 --- /dev/null +++ b/swaggerci/storage/generated/runtime/UndeclaredResponseException.cs @@ -0,0 +1,112 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System; + using System.Net.Http; + using System.Net.Http.Headers; + using static Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Extensions; + + public class RestException : Exception, IDisposable + { + public System.Net.HttpStatusCode StatusCode { get; set; } + public string Code { get; protected set; } + protected string message; + public HttpRequestMessage RequestMessage { get; protected set; } + public HttpResponseHeaders ResponseHeaders { get; protected set; } + + public string ResponseBody { get; protected set; } + public string ClientRequestId { get; protected set; } + public string RequestId { get; protected set; } + + public override string Message => message; + public string Action { get; protected set; } + + public RestException(System.Net.Http.HttpResponseMessage response) + { + StatusCode = response.StatusCode; + //CloneWithContent will not work here since the content is disposed after sendAsync + //Besides, it seems there is no need for the request content cloned here. + RequestMessage = response.RequestMessage.Clone(); + ResponseBody = response.Content.ReadAsStringAsync().Result; + ResponseHeaders = response.Headers; + + RequestId = response.GetFirstHeader("x-ms-request-id"); + ClientRequestId = response.GetFirstHeader("x-ms-client-request-id"); + + try + { + // try to parse the body as JSON, and see if a code and message are in there. + var json = Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonNode.Parse(ResponseBody) as Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json.JsonObject; + + // error message could be in properties.statusMessage + { message = If(json?.Property("properties"), out var p) + && If(p?.PropertyT("statusMessage"), out var sm) + ? (string)sm : (string)Message; } + + // see if there is an error block in the body + json = json?.Property("error") ?? json; + + { Code = If(json?.PropertyT("code"), out var c) ? (string)c : (string)StatusCode.ToString(); } + { message = If(json?.PropertyT("message"), out var m) ? (string)m : (string)Message; } + { Action = If(json?.PropertyT("action"), out var a) ? (string)a : (string)Action; } + } +#if DEBUG + catch (System.Exception E) + { + System.Console.Error.WriteLine($"{E.GetType().Name}/{E.Message}/{E.StackTrace}"); + } +#else + catch + { + // couldn't get the code/message from the body response. + // In this case, we will assume the response is the expected error message + if(!string.IsNullOrEmpty(ResponseBody)) { + message = ResponseBody; + } + } +#endif + if (string.IsNullOrEmpty(message)) + { + if (StatusCode >= System.Net.HttpStatusCode.BadRequest && StatusCode < System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Request Error, Status: {StatusCode}"; + } + else if (StatusCode >= System.Net.HttpStatusCode.InternalServerError) + { + message = $"The server responded with a Server Error, Status: {StatusCode}"; + } + else + { + message = $"The server responded with an unrecognized response, Status: {StatusCode}"; + } + } + } + + public void Dispose() + { + ((IDisposable)RequestMessage).Dispose(); + } + } + + public class RestException : RestException + { + public T Error { get; protected set; } + public RestException(System.Net.Http.HttpResponseMessage response, T error) : base(response) + { + Error = error; + } + } + + + public class UndeclaredResponseException : RestException + { + public UndeclaredResponseException(System.Net.Http.HttpResponseMessage response) : base(response) + { + + } + } +} \ No newline at end of file diff --git a/swaggerci/storage/generated/runtime/Writers/JsonWriter.cs b/swaggerci/storage/generated/runtime/Writers/JsonWriter.cs new file mode 100644 index 000000000000..24b423879659 --- /dev/null +++ b/swaggerci/storage/generated/runtime/Writers/JsonWriter.cs @@ -0,0 +1,223 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ +using System; +using System.Collections.Generic; +using System.IO; +using System.Web; + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.Json +{ + internal class JsonWriter + { + const string indentation = " "; // 2 spaces + + private readonly bool pretty; + private readonly TextWriter writer; + + protected int currentLevel = 0; + + internal JsonWriter(TextWriter writer, bool pretty = true) + { + this.writer = writer ?? throw new ArgumentNullException(nameof(writer)); + this.pretty = pretty; + } + + internal void WriteNode(JsonNode node) + { + switch (node.Type) + { + case JsonType.Array: WriteArray((IEnumerable)node); break; + case JsonType.Object: WriteObject((JsonObject)node); break; + + // Primitives + case JsonType.Binary: WriteBinary((XBinary)node); break; + case JsonType.Boolean: WriteBoolean((bool)node); break; + case JsonType.Date: WriteDate((JsonDate)node); break; + case JsonType.Null: WriteNull(); break; + case JsonType.Number: WriteNumber((JsonNumber)node); break; + case JsonType.String: WriteString(node); break; + } + } + + internal void WriteArray(IEnumerable array) + { + currentLevel++; + + writer.Write('['); + + bool doIndentation = false; + + if (pretty) + { + foreach (var node in array) + { + if (node.Type == JsonType.Object || node.Type == JsonType.Array) + { + doIndentation = true; + + break; + } + } + } + + bool isFirst = true; + + foreach (JsonNode node in array) + { + if (!isFirst) writer.Write(','); + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + WriteNode(node); + + isFirst = false; + } + + currentLevel--; + + if (doIndentation) + { + WriteIndent(); + } + else if (pretty) + { + writer.Write(' '); + } + + writer.Write(']'); + } + + internal void WriteIndent() + { + if (pretty) + { + writer.Write(Environment.NewLine); + + for (int level = 0; level < currentLevel; level++) + { + writer.Write(indentation); + } + } + } + + internal void WriteObject(JsonObject obj) + { + currentLevel++; + + writer.Write('{'); + + bool isFirst = true; + + foreach (var field in obj) + { + if (!isFirst) writer.Write(','); + + WriteIndent(); + + WriteFieldName(field.Key); + + writer.Write(':'); + + if (pretty) + { + writer.Write(' '); + } + + // Write the field value + WriteNode(field.Value); + + isFirst = false; + } + + currentLevel--; + + WriteIndent(); + + writer.Write('}'); + } + + internal void WriteFieldName(string fieldName) + { + writer.Write('"'); + writer.Write(HttpUtility.JavaScriptStringEncode(fieldName)); + writer.Write('"'); + } + + #region Primitives + + internal void WriteBinary(XBinary value) + { + writer.Write('"'); + writer.Write(value.ToString()); + writer.Write('"'); + } + + internal void WriteBoolean(bool value) + { + writer.Write(value ? "true" : "false"); + } + + internal void WriteDate(JsonDate date) + { + if (date.ToDateTime().Year == 1) + { + WriteNull(); + } + else + { + writer.Write('"'); + writer.Write(date.ToIsoString()); + writer.Write('"'); + } + } + + internal void WriteNull() + { + writer.Write("null"); + } + + internal void WriteNumber(JsonNumber number) + { + if (number.Overflows) + { + writer.Write('"'); + writer.Write(number.Value); + writer.Write('"'); + } + else + { + writer.Write(number.Value); + } + } + + internal void WriteString(string text) + { + if (text == null) + { + WriteNull(); + } + else + { + writer.Write('"'); + + writer.Write(HttpUtility.JavaScriptStringEncode(text)); + + writer.Write('"'); + } + } + + #endregion + } +} + + +// TODO: Replace with System.Text.Json when available diff --git a/swaggerci/storage/generated/runtime/delegates.cs b/swaggerci/storage/generated/runtime/delegates.cs new file mode 100644 index 000000000000..5f98054a63dd --- /dev/null +++ b/swaggerci/storage/generated/runtime/delegates.cs @@ -0,0 +1,23 @@ +/*--------------------------------------------------------------------------------------------- + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + +namespace Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime +{ + using System; + using System.Collections; + using System.Collections.Generic; + using System.Net.Http; + using System.Threading; + using System.Threading.Tasks; + using GetEventData=System.Func; + + public delegate Task SendAsync(HttpRequestMessage request, IEventListener callback); + public delegate Task SendAsyncStep(HttpRequestMessage request, IEventListener callback, ISendAsync next); + public delegate Task SignalEvent(string id, CancellationToken token, GetEventData getEventData); + public delegate Task Event(EventData message); + public delegate void SynchEvent(EventData message); + public delegate Task OnResponse(Response message); + public delegate Task OnResponse(Response message); +} \ No newline at end of file diff --git a/swaggerci/storage/how-to.md b/swaggerci/storage/how-to.md new file mode 100644 index 000000000000..11d75202dc18 --- /dev/null +++ b/swaggerci/storage/how-to.md @@ -0,0 +1,58 @@ +# How-To +This document describes how to develop for `Az.Storage`. + +## Building `Az.Storage` +To build, run the `build-module.ps1` at the root of the module directory. This will generate the proxy script cmdlets that are the cmdlets being exported by this module. After the build completes, the proxy script cmdlets will be output to the `exports` folder. To read more about the proxy script cmdlets, look at the [README.md](exports/README.md) in the `exports` folder. + +## Creating custom cmdlets +To add cmdlets that were not generated by the REST specification, use the `custom` folder. This folder allows you to add handwritten `.ps1` and `.cs` files. Currently, we support using `.ps1` scripts as new cmdlets or as additional low-level variants (via `ParameterSet`), and `.cs` files as low-level (variants) cmdlets that the exported script cmdlets call. We do not support exporting any `.cs` (dll) cmdlets directly. To read more about custom cmdlets, look at the [README.md](custom/README.md) in the `custom` folder. + +## Generating documentation +To generate documentation, the process is now integrated into the `build-module.ps1` script. If you don't want to run this process as part of `build-module.ps1`, you can provide the `-NoDocs` switch. If you want to run documentation generation after the build process, you may still run the `generate-help.ps1` script. Overall, the process will look at the documentation comments in the generated and custom cmdlets and types, and create `.md` files into the `docs` folder. Additionally, this pulls in any examples from the `examples` folder and adds them to the generated help markdown documents. To read more about examples, look at the [README.md](examples/README.md) in the `examples` folder. To read more about documentation, look at the [README.md](docs/README.md) in the `docs` folder. + +## Testing `Az.Storage` +To test the cmdlets, we use [Pester](https://github.com/pester/Pester). Tests scripts (`.ps1`) should be added to the `test` folder. To execute the Pester tests, run the `test-module.ps1` script. This will run all tests in `playback` mode within the `test` folder. To read more about testing cmdlets, look at the [README.md](examples/README.md) in the `examples` folder. + +## Packing `Az.Storage` +To pack `Az.Storage` for distribution, run the `pack-module.ps1` script. This will take the contents of multiple directories and certain root-folder files to create a `.nupkg`. The structure of the `.nupkg` is created so it can be loaded part of a [PSRepository](https://docs.microsoft.com/powershell/module/powershellget/register-psrepository). Additionally, this package is in a format for distribution to the [PSGallery](https://www.powershellgallery.com/). For signing an Azure module, please contact the [Azure PowerShell](https://github.com/Azure/azure-powershell) team. + +## Module Script Details +There are multiple scripts created for performing different actions for developing `Az.Storage`. +- `build-module.ps1` + - Builds the module DLL (`./bin/Az.Storage.private.dll`), creates the exported cmdlets and documentation, generates custom cmdlet test stubs and exported cmdlet example stubs, and updates `./Az.Storage.psd1` with Azure profile information. + - **Parameters**: [`Switch` parameters] + - `-Run`: After building, creates an isolated PowerShell session and loads `Az.Storage`. + - `-Test`: After building, runs the `Pester` tests defined in the `test` folder. + - `-Docs`: After building, generates the Markdown documents for the modules into the `docs` folder. + - `-Pack`: After building, packages the module into a `.nupkg`. + - `-Code`: After building, opens a VSCode window with the module's directory and runs (see `-Run`) the module. + - `-Release`: Builds the module in `Release` configuration (as opposed to `Debug` configuration). + - `-NoDocs`: Supresses writing the documentation markdown files as part of the cmdlet exporting process. + - `-Debugger`: Used when attaching the debugger in Visual Studio to the PowerShell session, and running the build process without recompiling the DLL. This suppresses running the script as an isolated process. +- `run-module.ps1` + - Creates an isolated PowerShell session and loads `Az.Storage` into the session. + - Same as `-Run` in `build-module.ps1`. + - **Parameters**: [`Switch` parameters] + - `-Code`: Opens a VSCode window with the module's directory. + - Same as `-Code` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. +- `test-module.ps1` + - Runs the `Pester` tests defined in the `test` folder. + - Same as `-Test` in `build-module.ps1`. +- `pack-module.ps1` + - Packages the module into a `.nupkg` for distribution. + - Same as `-Pack` in `build-module.ps1`. +- `generate-help.ps1` + - Generates the Markdown documents for the modules into the `docs` folder. + - Same as `-Docs` in `build-module.ps1`. + - This process is now integrated into `build-module.ps1` automatically. To disable, use `-NoDocs` when running `build-module.ps1`. +- `export-surface.ps1` + - Generates Markdown documents for both the cmdlet surface and the model (class) surface of the module. + - These files are placed into the `resources` folder. + - Used for investigating the surface of your module. These are *not* documentation for distribution. +- `check-dependencies.ps1` + - Used in `run-module.ps1` and `test-module.ps1` to verify dependent modules are available to run those tasks. + - It will download local (within the module's directory structure) versions of those modules as needed. + - This script *does not* need to be ran by-hand. \ No newline at end of file diff --git a/swaggerci/storage/internal/Az.Storage.internal.psm1 b/swaggerci/storage/internal/Az.Storage.internal.psm1 new file mode 100644 index 000000000000..d95e71758447 --- /dev/null +++ b/swaggerci/storage/internal/Az.Storage.internal.psm1 @@ -0,0 +1,38 @@ +# region Generated + # Load the private module dll + $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '../bin/Az.Storage.private.dll') + + # Get the private module's instance + $instance = [Microsoft.Azure.PowerShell.Cmdlets.Storage.Module]::Instance + + # Export nothing to clear implicit exports + Export-ModuleMember + + # Export proxy cmdlet scripts + $exportsPath = $PSScriptRoot + $directories = Get-ChildItem -Directory -Path $exportsPath + $profileDirectory = $null + if($instance.ProfileName) { + if(($directories | ForEach-Object { $_.Name }) -contains $instance.ProfileName) { + $profileDirectory = $directories | Where-Object { $_.Name -eq $instance.ProfileName } + } else { + # Don't export anything if the profile doesn't exist for the module + $exportsPath = $null + Write-Warning "Selected Azure profile '$($instance.ProfileName)' does not exist for module '$($instance.Name)'. No cmdlets were loaded." + } + } elseif(($directories | Measure-Object).Count -gt 0) { + # Load the last folder if no profile is selected + $profileDirectory = $directories | Select-Object -Last 1 + } + + if($profileDirectory) { + Write-Information "Loaded Azure profile '$($profileDirectory.Name)' for module '$($instance.Name)'" + $exportsPath = $profileDirectory.FullName + } + + if($exportsPath) { + Get-ChildItem -Path $exportsPath -Recurse -Include '*.ps1' -File | ForEach-Object { . $_.FullName } + $cmdletNames = Get-ScriptCmdlet -ScriptFolder $exportsPath + Export-ModuleMember -Function $cmdletNames -Alias (Get-ScriptCmdlet -ScriptFolder $exportsPath -AsAlias) + } +# endregion diff --git a/swaggerci/storage/internal/Get-AzStorageOperation.ps1 b/swaggerci/storage/internal/Get-AzStorageOperation.ps1 new file mode 100644 index 000000000000..4af11a877b6c --- /dev/null +++ b/swaggerci/storage/internal/Get-AzStorageOperation.ps1 @@ -0,0 +1,116 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists all of the available Storage Rest API operations. +.Description +Lists all of the available Storage Rest API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageoperation +#> +function Get-AzStorageOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/storage/internal/ProxyCmdletDefinitions.ps1 b/swaggerci/storage/internal/ProxyCmdletDefinitions.ps1 new file mode 100644 index 000000000000..4af11a877b6c --- /dev/null +++ b/swaggerci/storage/internal/ProxyCmdletDefinitions.ps1 @@ -0,0 +1,116 @@ + +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- + +<# +.Synopsis +Lists all of the available Storage Rest API operations. +.Description +Lists all of the available Storage Rest API operations. +.Example +{{ Add code here }} +.Example +{{ Add code here }} + +.Outputs +Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation +.Link +https://docs.microsoft.com/en-us/powershell/module/az.storage/get-azstorageoperation +#> +function Get-AzStorageOperation { +[OutputType([Microsoft.Azure.PowerShell.Cmdlets.Storage.Models.Api20220501.IOperation])] +[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)] +param( + [Parameter()] + [Alias('AzureRMContext', 'AzureCredential')] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Azure')] + [System.Management.Automation.PSObject] + # The credentials, account, tenant, and subscription used for communication with Azure. + ${DefaultProfile}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Wait for .NET debugger to attach + ${Break}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be appended to the front of the pipeline + ${HttpPipelineAppend}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Runtime.SendAsyncStep[]] + # SendAsync Pipeline Steps to be prepended to the front of the pipeline + ${HttpPipelinePrepend}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Uri] + # The URI for the proxy server to use + ${Proxy}, + + [Parameter(DontShow)] + [ValidateNotNull()] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.PSCredential] + # Credentials for a proxy server to use for the remote call + ${ProxyCredential}, + + [Parameter(DontShow)] + [Microsoft.Azure.PowerShell.Cmdlets.Storage.Category('Runtime')] + [System.Management.Automation.SwitchParameter] + # Use the default credentials for the proxy + ${ProxyUseDefaultCredentials} +) + +begin { + try { + $outBuffer = $null + if ($PSBoundParameters.TryGetValue('OutBuffer', [ref]$outBuffer)) { + $PSBoundParameters['OutBuffer'] = 1 + } + $parameterSet = $PSCmdlet.ParameterSetName + + $mapping = @{ + List = 'Az.Storage.private\Get-AzStorageOperation_List'; + } + + $wrappedCmd = $ExecutionContext.InvokeCommand.GetCommand(($mapping[$parameterSet]), [System.Management.Automation.CommandTypes]::Cmdlet) + $scriptCmd = {& $wrappedCmd @PSBoundParameters} + $steppablePipeline = $scriptCmd.GetSteppablePipeline($MyInvocation.CommandOrigin) + $steppablePipeline.Begin($PSCmdlet) + } catch { + + throw + } +} + +process { + try { + $steppablePipeline.Process($_) + } catch { + + throw + } + +} +end { + try { + $steppablePipeline.End() + + } catch { + + throw + } +} +} diff --git a/swaggerci/storage/internal/README.md b/swaggerci/storage/internal/README.md new file mode 100644 index 000000000000..f269994fa00a --- /dev/null +++ b/swaggerci/storage/internal/README.md @@ -0,0 +1,14 @@ +# Internal +This directory contains a module to handle *internal only* cmdlets. Cmdlets that you **hide** in configuration are created here. For more information on hiding, see [cmdlet hiding](https://github.com/Azure/autorest.powershell/blob/main/docs/directives.md#cmdlet-hiding-exportation-suppression). The cmdlets in this directory are generated at **build-time**. Do not put any custom code, files, cmdlets, etc. into this directory. Please use `../custom` for all custom implementation. + +## Info +- Modifiable: no +- Generated: all +- Committed: no +- Packaged: yes + +## Details +The `Az.Storage.internal.psm1` file is generated to this folder. This module file handles the hidden cmdlets. These cmdlets will not be exported by `Az.Storage`. Instead, this sub-module is imported by the `../custom/Az.Storage.custom.psm1` module, allowing you to use hidden cmdlets in your custom, exposed cmdlets. To call these cmdlets in your custom scripts, simply use [module-qualified calls](https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_command_precedence?view=powershell-6#qualified-names). For example, `Az.Storage.internal\Get-Example` would call an internal cmdlet named `Get-Example`. + +## Purpose +This allows you to include REST specifications for services that you *do not wish to expose from your module*, but simply want to call within custom cmdlets. For example, if you want to make a custom cmdlet that uses `Storage` services, you could include a simplified `Storage` REST specification that has only the operations you need. When you run the generator and build this module, note the generated `Storage` cmdlets. Then, in your readme configuration, use [cmdlet hiding](https://github.com/Azure/autorest/blob/master/docs/powershell/options.md#cmdlet-hiding-exportation-suppression) on the `Storage` cmdlets and they will *only be exposed to the custom cmdlets* you want to write, and not be exported as part of `Az.Storage`. diff --git a/swaggerci/storage/license.txt b/swaggerci/storage/license.txt new file mode 100644 index 000000000000..b9f3180fb9af --- /dev/null +++ b/swaggerci/storage/license.txt @@ -0,0 +1,227 @@ +MICROSOFT SOFTWARE LICENSE TERMS + +MICROSOFT AZURE POWERSHELL + +These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its affiliates) and you. Please read them. They apply to the software named above, which includes the media on which you received it, if any. + +BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. IF YOU DO NOT ACCEPT THEM, DO NOT USE THE SOFTWARE. + + +-----------------START OF LICENSE-------------------------- + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +-------------------END OF LICENSE------------------------------------------ + + +----------------START OF THIRD PARTY NOTICE-------------------------------- + + +The software includes the AutoMapper library ("AutoMapper"). The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Provided for Informational Purposes Only + +AutoMapper + +The MIT License (MIT) +Copyright (c) 2010 Jimmy Bogard + + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + + + + + +*************** + +The software includes Newtonsoft.Json. The MIT License set out below is provided for informational purposes only. It is not the license that governs any part of the software. + +Newtonsoft.Json + +The MIT License (MIT) +Copyright (c) 2007 James Newton-King +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +-------------END OF THIRD PARTY NOTICE---------------------------------------- + diff --git a/swaggerci/storage/pack-module.ps1 b/swaggerci/storage/pack-module.ps1 new file mode 100644 index 000000000000..8ed48957e579 --- /dev/null +++ b/swaggerci/storage/pack-module.ps1 @@ -0,0 +1,9 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +Write-Host -ForegroundColor Green 'Packing module...' +dotnet pack $PSScriptRoot --no-build /nologo +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storage/readme.md b/swaggerci/storage/readme.md new file mode 100644 index 000000000000..e8b392c420a1 --- /dev/null +++ b/swaggerci/storage/readme.md @@ -0,0 +1,10 @@ +### AutoRest Configuration +> see https://aka.ms/autorest + +``` yaml +require: + - $(this-folder)/../../tools/SwaggerCI/readme.azure.noprofile.md + - $(this-folder)/../../../azure-rest-api-specs/specification/storage/resource-manager/readme.md +try-require: + - $(this-folder)/../../../azure-rest-api-specs/specification/storage/resource-manager/readme.powershell.md +``` diff --git a/swaggerci/storage/resources/README.md b/swaggerci/storage/resources/README.md new file mode 100644 index 000000000000..736492341e3d --- /dev/null +++ b/swaggerci/storage/resources/README.md @@ -0,0 +1,11 @@ +# Resources +This directory can contain any additional resources for module that are not required at runtime. This directory **does not** get packaged with the module. If you have assets for custom implementation, place them into the `../custom` folder. + +## Info +- Modifiable: yes +- Generated: no +- Committed: yes +- Packaged: no + +## Purpose +Use this folder to put anything you want to keep around as part of the repository for the module, but is not something that is required for the module. For example, development files, packaged builds, or additional information. This is only intended to be used in repositories where the module's output directory is cleaned, but tangential resources for the module want to remain intact. \ No newline at end of file diff --git a/swaggerci/storage/run-module.ps1 b/swaggerci/storage/run-module.ps1 new file mode 100644 index 000000000000..2bb03a71dd17 --- /dev/null +++ b/swaggerci/storage/run-module.ps1 @@ -0,0 +1,54 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Code) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) { + Write-Host -ForegroundColor Green 'Creating isolated process...' + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NoExit -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +$isAzure = $true +if($isAzure) { + . (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts + # Load the latest version of Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) { + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.Storage.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +function Prompt { + Write-Host -NoNewline -ForegroundColor Green "PS $(Get-Location)" + Write-Host -NoNewline -ForegroundColor Gray ' [' + Write-Host -NoNewline -ForegroundColor White -BackgroundColor DarkCyan $moduleName + ']> ' +} + +# where we would find the launch.json file +$vscodeDirectory = New-Item -ItemType Directory -Force -Path (Join-Path $PSScriptRoot '.vscode') +$launchJson = Join-Path $vscodeDirectory 'launch.json' + +# if there is a launch.json file, let's just assume -Code, and update the file +if(($Code) -or (test-Path $launchJson) ) { + $launchContent = '{ "version": "0.2.0", "configurations":[{ "name":"Attach to PowerShell", "type":"coreclr", "request":"attach", "processId":"' + ([System.Diagnostics.Process]::GetCurrentProcess().Id) + '", "justMyCode":false }] }' + Set-Content -Path $launchJson -Value $launchContent + if($Code) { + # only launch vscode if they say -code + code $PSScriptRoot + } +} + +Import-Module -Name $modulePath \ No newline at end of file diff --git a/swaggerci/storage/test-module.ps1 b/swaggerci/storage/test-module.ps1 new file mode 100644 index 000000000000..d059027670d7 --- /dev/null +++ b/swaggerci/storage/test-module.ps1 @@ -0,0 +1,86 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +param([switch]$Isolated, [switch]$Live, [switch]$Record, [switch]$Playback, [switch]$RegenerateSupportModule, [switch]$UsePreviousConfigForRecord, [string[]]$TestName) +$ErrorActionPreference = 'Stop' + +if(-not $Isolated) +{ + Write-Host -ForegroundColor Green 'Creating isolated process...' + if ($PSBoundParameters.ContainsKey("TestName")) { + $PSBoundParameters["TestName"] = $PSBoundParameters["TestName"] -join "," + } + $pwsh = [System.Diagnostics.Process]::GetCurrentProcess().Path + & "$pwsh" -NonInteractive -NoLogo -NoProfile -File $MyInvocation.MyCommand.Path @PSBoundParameters -Isolated + return +} + +# This is a workaround, since for string array parameter, pwsh -File will only take the first element +if ($PSBoundParameters.ContainsKey("TestName") -and ($TestName.count -eq 1) -and ($TestName[0].Contains(','))) { + $TestName = $TestName[0].Split(",") +} + +$ProgressPreference = 'SilentlyContinue' +$baseName = $PSScriptRoot.BaseName +$requireResourceModule = (($baseName -ne "Resources") -and ($Record.IsPresent -or $Live.IsPresent)) +. (Join-Path $PSScriptRoot 'check-dependencies.ps1') -Isolated -Accounts:$false -Pester -Resources:$requireResourceModule -RegenerateSupportModule:$RegenerateSupportModule +. ("$PSScriptRoot\test\utils.ps1") + +if ($requireResourceModule) +{ + # Load the latest Az.Accounts installed + Import-Module -Name Az.Accounts -RequiredVersion (Get-Module -Name Az.Accounts -ListAvailable | Sort-Object -Property Version -Descending)[0].Version + $resourceModulePSD = Get-Item -Path (Join-Path $HOME '.PSSharedModules\Resources\Az.Resources.TestSupport.psd1') + Import-Module -Name $resourceModulePSD.FullName +} + +$localModulesPath = Join-Path $PSScriptRoot 'generated/modules' +if(Test-Path -Path $localModulesPath) +{ + $env:PSModulePath = "$localModulesPath$([IO.Path]::PathSeparator)$env:PSModulePath" +} + +$modulePsd1 = Get-Item -Path (Join-Path $PSScriptRoot './Az.Storage.psd1') +$modulePath = $modulePsd1.FullName +$moduleName = $modulePsd1.BaseName + +Import-Module -Name Pester +Import-Module -Name $modulePath + +$TestMode = 'playback' +$ExcludeTag = @("LiveOnly") +if($Live) +{ + $TestMode = 'live' + $ExcludeTag = @() +} +if($Record) +{ + $TestMode = 'record' +} +try +{ + if ($TestMode -ne 'playback') + { + setupEnv + } + $testFolder = Join-Path $PSScriptRoot 'test' + if ($null -ne $TestName) + { + Invoke-Pester -Script @{ Path = $testFolder } -TestName $TestName -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } else + { + Invoke-Pester -Script @{ Path = $testFolder } -ExcludeTag $ExcludeTag -EnableExit -OutputFile (Join-Path $testFolder "$moduleName-TestResults.xml") + } +} Finally +{ + if ($TestMode -ne 'playback') + { + cleanupEnv + } +} + +Write-Host -ForegroundColor Green '-------------Done-------------' \ No newline at end of file diff --git a/swaggerci/storage/test/Clear-AzStorageBlobContainerLegalHold.Tests.ps1 b/swaggerci/storage/test/Clear-AzStorageBlobContainerLegalHold.Tests.ps1 new file mode 100644 index 000000000000..6521abeb64e0 --- /dev/null +++ b/swaggerci/storage/test/Clear-AzStorageBlobContainerLegalHold.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Clear-AzStorageBlobContainerLegalHold')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Clear-AzStorageBlobContainerLegalHold.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Clear-AzStorageBlobContainerLegalHold' { + It 'ClearExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Clear' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ClearViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ClearViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageAccount.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..6da7a1557535 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageAccount.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageAccount' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List1' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageAccountKey.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageAccountKey.Tests.ps1 new file mode 100644 index 000000000000..4c03cf7e3998 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageAccountKey.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageAccountKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageAccountKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageAccountKey' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageAccountProperty.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageAccountProperty.Tests.ps1 new file mode 100644 index 000000000000..e3a25f2b47e9 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageAccountProperty.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageAccountProperty')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageAccountProperty.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageAccountProperty' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageAccountSas.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageAccountSas.Tests.ps1 new file mode 100644 index 000000000000..be291587b3c8 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageAccountSas.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageAccountSas')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageAccountSas.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageAccountSas' { + It 'ListExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageAccountServiceSas.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageAccountServiceSas.Tests.ps1 new file mode 100644 index 000000000000..e50021f0160b --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageAccountServiceSas.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageAccountServiceSas')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageAccountServiceSas.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageAccountServiceSas' { + It 'ListExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..2f78c7bf0317 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageBlobContainer.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageBlobContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageBlobContainer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageBlobContainer' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..3dcf349c54f6 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageBlobContainerImmutabilityPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageBlobContainerImmutabilityPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageBlobContainerImmutabilityPolicy' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageBlobInventoryPolicy.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageBlobInventoryPolicy.Tests.ps1 new file mode 100644 index 000000000000..ed7b52c727c8 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageBlobInventoryPolicy.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageBlobInventoryPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageBlobInventoryPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageBlobInventoryPolicy' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageBlobService.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageBlobService.Tests.ps1 new file mode 100644 index 000000000000..ea69ab618430 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageBlobService.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageBlobService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageBlobService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageBlobService' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageBlobServiceProperty.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageBlobServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..bf60530b7a41 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageBlobServiceProperty.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageBlobServiceProperty')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageBlobServiceProperty.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageBlobServiceProperty' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageDeletedAccount.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageDeletedAccount.Tests.ps1 new file mode 100644 index 000000000000..93649abb0060 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageDeletedAccount.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageDeletedAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageDeletedAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageDeletedAccount' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageEncryptionScope.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageEncryptionScope.Tests.ps1 new file mode 100644 index 000000000000..023b3d911444 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageEncryptionScope.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageEncryptionScope')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageEncryptionScope.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageEncryptionScope' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageFileService.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageFileService.Tests.ps1 new file mode 100644 index 000000000000..474899d7cb51 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageFileService.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageFileService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageFileService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageFileService' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageFileServiceProperty.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageFileServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..64e11923bf91 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageFileServiceProperty.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageFileServiceProperty')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageFileServiceProperty.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageFileServiceProperty' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageFileShare.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..d8f43b05eba0 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageFileShare.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageFileShare' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageLocalUser.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageLocalUser.Tests.ps1 new file mode 100644 index 000000000000..d1ba37ab60fd --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageLocalUser.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageLocalUser')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageLocalUser.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageLocalUser' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageLocalUserKey.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageLocalUserKey.Tests.ps1 new file mode 100644 index 000000000000..96f762891b87 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageLocalUserKey.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageLocalUserKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageLocalUserKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageLocalUserKey' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageManagementPolicy.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageManagementPolicy.Tests.ps1 new file mode 100644 index 000000000000..21206b38c3eb --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageManagementPolicy.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageManagementPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageManagementPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageManagementPolicy' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageObjectReplicationPolicy.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageObjectReplicationPolicy.Tests.ps1 new file mode 100644 index 000000000000..021d19e08c85 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageObjectReplicationPolicy.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageObjectReplicationPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageObjectReplicationPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageObjectReplicationPolicy' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStoragePrivateEndpointConnection.Tests.ps1 b/swaggerci/storage/test/Get-AzStoragePrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..f8ff8865f41d --- /dev/null +++ b/swaggerci/storage/test/Get-AzStoragePrivateEndpointConnection.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStoragePrivateEndpointConnection')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStoragePrivateEndpointConnection.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStoragePrivateEndpointConnection' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStoragePrivateLinkResource.Tests.ps1 b/swaggerci/storage/test/Get-AzStoragePrivateLinkResource.Tests.ps1 new file mode 100644 index 000000000000..6f835195a6f8 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStoragePrivateLinkResource.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStoragePrivateLinkResource')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStoragePrivateLinkResource.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStoragePrivateLinkResource' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageQueue.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..9c100ecd95ce --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageQueue.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageQueue')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageQueue.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageQueue' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageQueueService.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageQueueService.Tests.ps1 new file mode 100644 index 000000000000..a373096b9783 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageQueueService.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageQueueService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageQueueService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageQueueService' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageQueueServiceProperty.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageQueueServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..984ce17a68e8 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageQueueServiceProperty.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageQueueServiceProperty')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageQueueServiceProperty.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageQueueServiceProperty' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageSku.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageSku.Tests.ps1 new file mode 100644 index 000000000000..460482e6074f --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageSku.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageSku')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageSku.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageSku' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageTable.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..89831a4301ca --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageTable.Tests.ps1 @@ -0,0 +1,29 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageTable')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageTable.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageTable' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageTableService.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageTableService.Tests.ps1 new file mode 100644 index 000000000000..3496c4887622 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageTableService.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageTableService')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageTableService.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageTableService' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageTableServiceProperty.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageTableServiceProperty.Tests.ps1 new file mode 100644 index 000000000000..8b7202009031 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageTableServiceProperty.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageTableServiceProperty')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageTableServiceProperty.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageTableServiceProperty' { + It 'Get' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'GetViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Get-AzStorageUsage.Tests.ps1 b/swaggerci/storage/test/Get-AzStorageUsage.Tests.ps1 new file mode 100644 index 000000000000..3f891ec88917 --- /dev/null +++ b/swaggerci/storage/test/Get-AzStorageUsage.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Get-AzStorageUsage')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Get-AzStorageUsage.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Get-AzStorageUsage' { + It 'List' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.Tests.ps1 b/swaggerci/storage/test/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.Tests.ps1 new file mode 100644 index 000000000000..b7aa18622b7f --- /dev/null +++ b/swaggerci/storage/test/Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorageAbortStorageAccountHierarchicalNamespaceMigration' { + It 'Abort' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'AbortViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage/test/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..a04aa0725948 --- /dev/null +++ b/swaggerci/storage/test/Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageExtendBlobContainerImmutabilityPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageExtendBlobContainerImmutabilityPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorageExtendBlobContainerImmutabilityPolicy' { + It 'ExtendExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Extend' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ExtendViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ExtendViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.Tests.ps1 b/swaggerci/storage/test/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.Tests.ps1 new file mode 100644 index 000000000000..90d32794d368 --- /dev/null +++ b/swaggerci/storage/test/Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorageHierarchicalStorageAccountNamespaceMigration' { + It 'Hierarchical' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'HierarchicalViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Invoke-AzStorageLeaseBlobContainer.Tests.ps1 b/swaggerci/storage/test/Invoke-AzStorageLeaseBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..0c313dfc0788 --- /dev/null +++ b/swaggerci/storage/test/Invoke-AzStorageLeaseBlobContainer.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageLeaseBlobContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageLeaseBlobContainer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorageLeaseBlobContainer' { + It 'LeaseExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Lease' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'LeaseViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'LeaseViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Invoke-AzStorageLeaseFileShare.Tests.ps1 b/swaggerci/storage/test/Invoke-AzStorageLeaseFileShare.Tests.ps1 new file mode 100644 index 000000000000..43057b7595f5 --- /dev/null +++ b/swaggerci/storage/test/Invoke-AzStorageLeaseFileShare.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageLeaseFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageLeaseFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorageLeaseFileShare' { + It 'LeaseExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Lease' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'LeaseViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'LeaseViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Invoke-AzStorageObjectBlobContainerLevelWorm.Tests.ps1 b/swaggerci/storage/test/Invoke-AzStorageObjectBlobContainerLevelWorm.Tests.ps1 new file mode 100644 index 000000000000..91d46a040306 --- /dev/null +++ b/swaggerci/storage/test/Invoke-AzStorageObjectBlobContainerLevelWorm.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Invoke-AzStorageObjectBlobContainerLevelWorm')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Invoke-AzStorageObjectBlobContainerLevelWorm.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Invoke-AzStorageObjectBlobContainerLevelWorm' { + It 'Object' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'ObjectViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Lock-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage/test/Lock-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..04d0d1c72b48 --- /dev/null +++ b/swaggerci/storage/test/Lock-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Lock-AzStorageBlobContainerImmutabilityPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Lock-AzStorageBlobContainerImmutabilityPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Lock-AzStorageBlobContainerImmutabilityPolicy' { + It 'Lock' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'LockViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageAccount.Tests.ps1 b/swaggerci/storage/test/New-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..ae629d05df10 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageAccount.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageAccount' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageAccountKey.Tests.ps1 b/swaggerci/storage/test/New-AzStorageAccountKey.Tests.ps1 new file mode 100644 index 000000000000..a67536fa0a11 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageAccountKey.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageAccountKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageAccountKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageAccountKey' { + It 'RegenerateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Regenerate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage/test/New-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..3f36f1bd6cdc --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageBlobContainer.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageBlobContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageBlobContainer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageBlobContainer' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage/test/New-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..38c6a8a87ae3 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageBlobContainerImmutabilityPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageBlobContainerImmutabilityPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageBlobContainerImmutabilityPolicy' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageBlobInventoryPolicy.Tests.ps1 b/swaggerci/storage/test/New-AzStorageBlobInventoryPolicy.Tests.ps1 new file mode 100644 index 000000000000..2d5c25eb553e --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageBlobInventoryPolicy.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageBlobInventoryPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageBlobInventoryPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageBlobInventoryPolicy' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageFileShare.Tests.ps1 b/swaggerci/storage/test/New-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..1408b8140eab --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageFileShare.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageFileShare' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageLocalUser.Tests.ps1 b/swaggerci/storage/test/New-AzStorageLocalUser.Tests.ps1 new file mode 100644 index 000000000000..e9ea6863cb03 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageLocalUser.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageLocalUser')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageLocalUser.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageLocalUser' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageLocalUserPassword.Tests.ps1 b/swaggerci/storage/test/New-AzStorageLocalUserPassword.Tests.ps1 new file mode 100644 index 000000000000..8cb061ff1cb7 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageLocalUserPassword.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageLocalUserPassword')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageLocalUserPassword.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageLocalUserPassword' { + It 'Regenerate' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RegenerateViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageManagementPolicy.Tests.ps1 b/swaggerci/storage/test/New-AzStorageManagementPolicy.Tests.ps1 new file mode 100644 index 000000000000..d31c7eade591 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageManagementPolicy.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageManagementPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageManagementPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageManagementPolicy' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageObjectReplicationPolicy.Tests.ps1 b/swaggerci/storage/test/New-AzStorageObjectReplicationPolicy.Tests.ps1 new file mode 100644 index 000000000000..01303149fbd2 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageObjectReplicationPolicy.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageObjectReplicationPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageObjectReplicationPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageObjectReplicationPolicy' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageQueue.Tests.ps1 b/swaggerci/storage/test/New-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..f947749bf44e --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageQueue.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageQueue')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageQueue.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageQueue' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/New-AzStorageTable.Tests.ps1 b/swaggerci/storage/test/New-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..cd04075b3a18 --- /dev/null +++ b/swaggerci/storage/test/New-AzStorageTable.Tests.ps1 @@ -0,0 +1,21 @@ +if(($null -eq $TestName) -or ($TestName -contains 'New-AzStorageTable')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'New-AzStorageTable.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'New-AzStorageTable' { + It 'CreateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/README.md b/swaggerci/storage/test/README.md new file mode 100644 index 000000000000..1969200c6a09 --- /dev/null +++ b/swaggerci/storage/test/README.md @@ -0,0 +1,17 @@ +# Test +This directory contains the [Pester](https://www.powershellgallery.com/packages/Pester) tests to run for the module. We use Pester as it is the unofficial standard for PowerShell unit testing. Test stubs for custom cmdlets (created in `../custom`) will be generated into this folder when `build-module.ps1` is ran. These test stubs will fail automatically, to indicate that tests should be written for custom cmdlets. + +## Info +- Modifiable: yes +- Generated: partial +- Committed: yes +- Packaged: no + +## Details +We allow three testing modes: *live*, *record*, and *playback*. These can be selected using the `-Live`, `-Record`, and `-Playback` switches respectively on the `test-module.ps1` script. This script will run through any `.Tests.ps1` scripts in the `test` folder. If you choose the *record* mode, it will create a `.Recording.json` file of the REST calls between the client and server. Then, when you choose *playback* mode, it will use the `.Recording.json` file to mock the communication between server and client. The *live* mode runs the same as the *record* mode; however, it doesn't create the `.Recording.json` file. + +## Purpose +Custom cmdlets generally encompass additional functionality not described in the REST specification, or combines functionality generated from the REST spec. To validate this functionality continues to operate as intended, creating tests that can be ran and re-ran against custom cmdlets is part of the framework. + +## Usage +To execute tests, run the `test-module.ps1`. To write tests, [this example](https://github.com/pester/Pester/blob/8b9cf4248315e44f1ac6673be149f7e0d7f10466/Examples/Planets/Get-Planet.Tests.ps1#L1) from the Pester repository is very useful for getting started. \ No newline at end of file diff --git a/swaggerci/storage/test/Remove-AzStorageAccount.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..7be08d385468 --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageAccount.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageAccount' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..f85b66968736 --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageBlobContainer.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageBlobContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageBlobContainer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageBlobContainer' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 new file mode 100644 index 000000000000..cb770a548e0f --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageBlobContainerImmutabilityPolicy.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageBlobContainerImmutabilityPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageBlobContainerImmutabilityPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageBlobContainerImmutabilityPolicy' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageBlobInventoryPolicy.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageBlobInventoryPolicy.Tests.ps1 new file mode 100644 index 000000000000..e393c13dfa91 --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageBlobInventoryPolicy.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageBlobInventoryPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageBlobInventoryPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageBlobInventoryPolicy' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageFileShare.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..cd6158f0f7b1 --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageFileShare.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageFileShare' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageLocalUser.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageLocalUser.Tests.ps1 new file mode 100644 index 000000000000..8c4685a9ccfa --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageLocalUser.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageLocalUser')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageLocalUser.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageLocalUser' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageManagementPolicy.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageManagementPolicy.Tests.ps1 new file mode 100644 index 000000000000..be6beac3506d --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageManagementPolicy.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageManagementPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageManagementPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageManagementPolicy' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageObjectReplicationPolicy.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageObjectReplicationPolicy.Tests.ps1 new file mode 100644 index 000000000000..114ae3d844d9 --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageObjectReplicationPolicy.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageObjectReplicationPolicy')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageObjectReplicationPolicy.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageObjectReplicationPolicy' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStoragePrivateEndpointConnection.Tests.ps1 b/swaggerci/storage/test/Remove-AzStoragePrivateEndpointConnection.Tests.ps1 new file mode 100644 index 000000000000..c2b2555694ab --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStoragePrivateEndpointConnection.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStoragePrivateEndpointConnection')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStoragePrivateEndpointConnection.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStoragePrivateEndpointConnection' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageQueue.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..30c4f65768b4 --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageQueue.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageQueue')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageQueue.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageQueue' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Remove-AzStorageTable.Tests.ps1 b/swaggerci/storage/test/Remove-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..9d61c9298d2b --- /dev/null +++ b/swaggerci/storage/test/Remove-AzStorageTable.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Remove-AzStorageTable')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Remove-AzStorageTable.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Remove-AzStorageTable' { + It 'Delete' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'DeleteViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Restore-AzStorageAccountBlobRange.Tests.ps1 b/swaggerci/storage/test/Restore-AzStorageAccountBlobRange.Tests.ps1 new file mode 100644 index 000000000000..36b95b4b632c --- /dev/null +++ b/swaggerci/storage/test/Restore-AzStorageAccountBlobRange.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Restore-AzStorageAccountBlobRange')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Restore-AzStorageAccountBlobRange.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Restore-AzStorageAccountBlobRange' { + It 'RestoreViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RestoreExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Restore' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RestoreViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Restore-AzStorageFileShare.Tests.ps1 b/swaggerci/storage/test/Restore-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..9aa8a8ba32dd --- /dev/null +++ b/swaggerci/storage/test/Restore-AzStorageFileShare.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Restore-AzStorageFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Restore-AzStorageFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Restore-AzStorageFileShare' { + It 'RestoreExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Restore' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RestoreViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RestoreViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Revoke-AzStorageAccountUserDelegationKey.Tests.ps1 b/swaggerci/storage/test/Revoke-AzStorageAccountUserDelegationKey.Tests.ps1 new file mode 100644 index 000000000000..289a1055d29c --- /dev/null +++ b/swaggerci/storage/test/Revoke-AzStorageAccountUserDelegationKey.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Revoke-AzStorageAccountUserDelegationKey')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Revoke-AzStorageAccountUserDelegationKey.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Revoke-AzStorageAccountUserDelegationKey' { + It 'Revoke' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'RevokeViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Test-AzStorageAccountNameAvailability.Tests.ps1 b/swaggerci/storage/test/Test-AzStorageAccountNameAvailability.Tests.ps1 new file mode 100644 index 000000000000..1fe3431ee96c --- /dev/null +++ b/swaggerci/storage/test/Test-AzStorageAccountNameAvailability.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Test-AzStorageAccountNameAvailability')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Test-AzStorageAccountNameAvailability.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Test-AzStorageAccountNameAvailability' { + It 'CheckExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Check' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'CheckViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Update-AzStorageAccount.Tests.ps1 b/swaggerci/storage/test/Update-AzStorageAccount.Tests.ps1 new file mode 100644 index 000000000000..b7121ee74bbe --- /dev/null +++ b/swaggerci/storage/test/Update-AzStorageAccount.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageAccount')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageAccount.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorageAccount' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Update-AzStorageBlobContainer.Tests.ps1 b/swaggerci/storage/test/Update-AzStorageBlobContainer.Tests.ps1 new file mode 100644 index 000000000000..1d4ebd7281e5 --- /dev/null +++ b/swaggerci/storage/test/Update-AzStorageBlobContainer.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageBlobContainer')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageBlobContainer.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorageBlobContainer' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Update-AzStorageEncryptionScope.Tests.ps1 b/swaggerci/storage/test/Update-AzStorageEncryptionScope.Tests.ps1 new file mode 100644 index 000000000000..1b20809d1b6f --- /dev/null +++ b/swaggerci/storage/test/Update-AzStorageEncryptionScope.Tests.ps1 @@ -0,0 +1,33 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageEncryptionScope')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageEncryptionScope.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorageEncryptionScope' { + It 'PatchExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'Patch' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PatchViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'PatchViaIdentity' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Update-AzStorageFileShare.Tests.ps1 b/swaggerci/storage/test/Update-AzStorageFileShare.Tests.ps1 new file mode 100644 index 000000000000..8b9e9c9ad47b --- /dev/null +++ b/swaggerci/storage/test/Update-AzStorageFileShare.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageFileShare')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageFileShare.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorageFileShare' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Update-AzStorageQueue.Tests.ps1 b/swaggerci/storage/test/Update-AzStorageQueue.Tests.ps1 new file mode 100644 index 000000000000..f4dd7a70c3cf --- /dev/null +++ b/swaggerci/storage/test/Update-AzStorageQueue.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageQueue')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageQueue.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorageQueue' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/Update-AzStorageTable.Tests.ps1 b/swaggerci/storage/test/Update-AzStorageTable.Tests.ps1 new file mode 100644 index 000000000000..751e69048aa2 --- /dev/null +++ b/swaggerci/storage/test/Update-AzStorageTable.Tests.ps1 @@ -0,0 +1,25 @@ +if(($null -eq $TestName) -or ($TestName -contains 'Update-AzStorageTable')) +{ + $loadEnvPath = Join-Path $PSScriptRoot 'loadEnv.ps1' + if (-Not (Test-Path -Path $loadEnvPath)) { + $loadEnvPath = Join-Path $PSScriptRoot '..\loadEnv.ps1' + } + . ($loadEnvPath) + $TestRecordingFile = Join-Path $PSScriptRoot 'Update-AzStorageTable.Recording.json' + $currentPath = $PSScriptRoot + while(-not $mockingPath) { + $mockingPath = Get-ChildItem -Path $currentPath -Recurse -Include 'HttpPipelineMocking.ps1' -File + $currentPath = Split-Path -Path $currentPath -Parent + } + . ($mockingPath | Select-Object -First 1).FullName +} + +Describe 'Update-AzStorageTable' { + It 'UpdateExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } + + It 'UpdateViaIdentityExpanded' -skip { + { throw [System.NotImplementedException] } | Should -Not -Throw + } +} diff --git a/swaggerci/storage/test/loadEnv.ps1 b/swaggerci/storage/test/loadEnv.ps1 new file mode 100644 index 000000000000..0ea394729062 --- /dev/null +++ b/swaggerci/storage/test/loadEnv.ps1 @@ -0,0 +1,21 @@ +# ---------------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for license information. +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is regenerated. +# ---------------------------------------------------------------------------------- +$envFile = 'env.json' +if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' +} + +if (Test-Path -Path (Join-Path $PSScriptRoot $envFile)) { + $envFilePath = Join-Path $PSScriptRoot $envFile +} else { + $envFilePath = Join-Path $PSScriptRoot '..\$envFile' +} +$env = @{} +if (Test-Path -Path $envFilePath) { + $env = Get-Content (Join-Path $PSScriptRoot $envFile) | ConvertFrom-Json + $PSDefaultParameterValues=@{"*:SubscriptionId"=$env.SubscriptionId; "*:Tenant"=$env.Tenant} +} \ No newline at end of file diff --git a/swaggerci/storage/test/utils.ps1 b/swaggerci/storage/test/utils.ps1 new file mode 100644 index 000000000000..1990edd45299 --- /dev/null +++ b/swaggerci/storage/test/utils.ps1 @@ -0,0 +1,31 @@ +function RandomString([bool]$allChars, [int32]$len) { + if ($allChars) { + return -join ((33..126) | Get-Random -Count $len | % {[char]$_}) + } else { + return -join ((48..57) + (97..122) | Get-Random -Count $len | % {[char]$_}) + } +} +$env = @{} +if ($UsePreviousConfigForRecord) { + $previousEnv = Get-Content (Join-Path $PSScriptRoot 'env.json') | ConvertFrom-Json + $previousEnv.psobject.properties | Foreach-Object { $env[$_.Name] = $_.Value } +} +# Add script method called AddWithCache to $env, when useCache is set true, it will try to get the value from the $env first. +# example: $val = $env.AddWithCache('key', $val, $true) +$env | Add-Member -Type ScriptMethod -Value { param( [string]$key, [object]$val, [bool]$useCache) if ($this.Contains($key) -and $useCache) { return $this[$key] } else { $this[$key] = $val; return $val } } -Name 'AddWithCache' +function setupEnv() { + # Preload subscriptionId and tenant from context, which will be used in test + # as default. You could change them if needed. + $env.SubscriptionId = (Get-AzContext).Subscription.Id + $env.Tenant = (Get-AzContext).Tenant.Id + # For any resources you created for test, you should add it to $env here. + $envFile = 'env.json' + if ($TestMode -eq 'live') { + $envFile = 'localEnv.json' + } + set-content -Path (Join-Path $PSScriptRoot $envFile) -Value (ConvertTo-Json $env) +} +function cleanupEnv() { + # Clean resources you create for testing +} + diff --git a/swaggerci/storage/utils/Unprotect-SecureString.ps1 b/swaggerci/storage/utils/Unprotect-SecureString.ps1 new file mode 100644 index 000000000000..cb05b51a6220 --- /dev/null +++ b/swaggerci/storage/utils/Unprotect-SecureString.ps1 @@ -0,0 +1,16 @@ +#This script converts securestring to plaintext + +param( + [Parameter(Mandatory, ValueFromPipeline)] + [System.Security.SecureString] + ${SecureString} +) + +$ssPtr = [System.Runtime.InteropServices.Marshal]::SecureStringToBSTR($SecureString) +try { + $plaintext = [System.Runtime.InteropServices.Marshal]::PtrToStringBSTR($ssPtr) +} finally { + [System.Runtime.InteropServices.Marshal]::ZeroFreeBSTR($ssPtr) +} + +return $plaintext \ No newline at end of file